mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
fix non-dummy objectives not updating
This commit is contained in:
parent
89e4cfa6de
commit
02867ba131
1 changed files with 13 additions and 0 deletions
|
@ -39,6 +39,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
CraftScoreboard(Scoreboard board) {
|
||||
this.board = board;
|
||||
@@ -0,0 +0,0 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
|
||||
Validate.isTrue(name.length() <= 16, "The name '" + name + "' is longer than the limit of 16 characters");
|
||||
Validate.isTrue(board.getObjective(name) == null, "An objective of name '" + name + "' already exists");
|
||||
CraftCriteria craftCriteria = CraftCriteria.getFromBukkit(criteria);
|
||||
+ // 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 != net.minecraft.world.scores.criteria.IScoreboardCriteria.DUMMY && !registeredGlobally) {
|
||||
+ net.minecraft.server.MinecraftServer.getServer().server.getScoreboardManager().registerScoreboardForVanilla(this);
|
||||
+ registeredGlobally = true;
|
||||
+ }
|
||||
+ // Paper end
|
||||
ScoreboardObjective objective = board.registerObjective(name, craftCriteria.criteria, io.papermc.paper.adventure.PaperAdventure.asVanilla(displayName), CraftScoreboardTranslations.fromBukkitRender(renderType));
|
||||
return new CraftObjective(this, objective);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
|
||||
Validate.isTrue(board.getObjective(name) == null, "An objective of name '" + name + "' already exists");
|
||||
|
||||
|
|
Loading…
Reference in a new issue