Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9301)
This commit is contained in:
@@ -26,13 +26,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
CraftScoreboard(Scoreboard board) {
|
||||
this.board = board;
|
||||
@@ -0,0 +0,0 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
|
||||
Validate.notNull(renderType, "RenderType cannot be null");
|
||||
Validate.isTrue(name.length() <= Short.MAX_VALUE, "The name '" + name + "' is longer than the limit of 32767 characters");
|
||||
Validate.isTrue(board.getObjective(name) == null, "An objective of name '" + name + "' already exists");
|
||||
Preconditions.checkArgument(renderType != null, "RenderType cannot be null");
|
||||
Preconditions.checkArgument(name.length() <= Short.MAX_VALUE, "The name '%s' is longer than the limit of 32767 characters (%s)", name, name.length());
|
||||
Preconditions.checkArgument(this.board.getObjective(name) == null, "An objective of name '%s' already exists", name);
|
||||
+ // Paper start - the block comment from the old registerNewObjective didnt cause a conflict when rebasing, so this block wasn't added to the adventure registerNewObjective
|
||||
+ if (((CraftCriteria) criteria).criteria != net.minecraft.world.scores.criteria.ObjectiveCriteria.DUMMY && !registeredGlobally) {
|
||||
+ if (((CraftCriteria) criteria).criteria != net.minecraft.world.scores.criteria.ObjectiveCriteria.DUMMY && !this.registeredGlobally) {
|
||||
+ net.minecraft.server.MinecraftServer.getServer().server.getScoreboardManager().registerScoreboardForVanilla(this);
|
||||
+ registeredGlobally = true;
|
||||
+ this.registeredGlobally = true;
|
||||
+ }
|
||||
+ // Paper end
|
||||
net.minecraft.world.scores.Objective objective = board.addObjective(name, ((CraftCriteria) criteria).criteria, io.papermc.paper.adventure.PaperAdventure.asVanilla(displayName), CraftScoreboardTranslations.fromBukkitRender(renderType));
|
||||
|
||||
Reference in New Issue
Block a user