From 02867ba1313a8a36d8fc7d7b165ed76fc290874f Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 22 Apr 2021 21:43:56 -0700 Subject: [PATCH] fix non-dummy objectives not updating --- ...Lazily-track-plugin-scoreboards-by-default.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Spigot-Server-Patches/Lazily-track-plugin-scoreboards-by-default.patch b/Spigot-Server-Patches/Lazily-track-plugin-scoreboards-by-default.patch index dcf183ed18..d50d241b01 100644 --- a/Spigot-Server-Patches/Lazily-track-plugin-scoreboards-by-default.patch +++ b/Spigot-Server-Patches/Lazily-track-plugin-scoreboards-by-default.patch @@ -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");