Open
Conversation
tal5
requested changes
Dec 13, 2025
plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/SidebarCommand.java
Show resolved
Hide resolved
tal5
requested changes
Jan 12, 2026
| Debug.report(scriptEntry, getName(), action, elTitle, elScores, elValue, elIncrement, elStart, db("players", players)); | ||
| } | ||
| if (players == null) { | ||
| players = Utilities.entryHasPlayer(scriptEntry) ? Collections.singletonList(Utilities.getEntryPlayer(scriptEntry)) : Collections.emptyList(); |
Member
There was a problem hiding this comment.
List.of methods are cleaner usually
| && !scriptEntry.hasObject("increment") && !scriptEntry.hasObject("start")) { | ||
| throw new InvalidArgumentsException("Must specify at least one of: value(s), title, increment, or start for that action!"); | ||
| if (action == Action.SET && stringValues == null && stringTitle == null) { | ||
| Debug.echoError("Must specify at least one of: value(s), title, increment, or start for that action!"); |
Member
There was a problem hiding this comment.
increment has a default value now and isn't checked here anymore, either remove the default value and add back the check so that it's like before (is -1 a correct default value for this?) or remove it from the error.
Comment on lines
+266
to
+273
| public static BukkitTagContext getContext(PlayerTag player, BukkitTagContext global, boolean perPlayer) { | ||
| if (perPlayer) { | ||
| BukkitTagContext context = new BukkitTagContext(global); | ||
| context.player = player; | ||
| return context; | ||
| } | ||
| return global; | ||
| } |
Member
There was a problem hiding this comment.
This makes a new context every time, but you only really need the global context or a single copy to change the player on for per_player.
| else { | ||
| current.add(new Sidebar.SidebarLine(value.get(i), score)); | ||
| } | ||
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First part of updating
sidebarcommand. Related discussion - https://discord.com/channels/315163488085475337/1439931889405395027