aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2021-04-22 21:43:56 -0700
committerNassim <[email protected]>2021-04-23 21:12:36 +0200
commitfb56fc35ed38c72685e47dfd83414dadf6ea4b01 (patch)
tree1b288594d934fb2ca159b058b4fa9c83f82ba074
parentdc859a61f06f75b3965f079861a9b9ad3c13c67d (diff)
downloadPaper-fb56fc35ed38c72685e47dfd83414dadf6ea4b01.tar.gz
Paper-fb56fc35ed38c72685e47dfd83414dadf6ea4b01.zip
fix non-dummy objectives not updating
-rw-r--r--Spigot-Server-Patches/0574-Lazily-track-plugin-scoreboards-by-default.patch17
1 files changed, 15 insertions, 2 deletions
diff --git a/Spigot-Server-Patches/0574-Lazily-track-plugin-scoreboards-by-default.patch b/Spigot-Server-Patches/0574-Lazily-track-plugin-scoreboards-by-default.patch
index 62b39e1d6d..974e02ca68 100644
--- a/Spigot-Server-Patches/0574-Lazily-track-plugin-scoreboards-by-default.patch
+++ b/Spigot-Server-Patches/0574-Lazily-track-plugin-scoreboards-by-default.patch
@@ -28,7 +28,7 @@ index 545948f20efd6c8dd42140b565af94cd6b52b661..7d50aded88f5b7dfebaea1aebc86231f
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
-index 6ea491f6308317059c4bc6735abbdce370df0f34..88bc3fbfa3bfb27cc4f9003a99cbce6e58def98f 100644
+index 6ea491f6308317059c4bc6735abbdce370df0f34..3dfb6ad1ed5fae773b88cbe9ad540fd2520b8b50 100644
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
@@ -19,6 +19,7 @@ import org.bukkit.scoreboard.Team;
@@ -39,7 +39,20 @@ index 6ea491f6308317059c4bc6735abbdce370df0f34..88bc3fbfa3bfb27cc4f9003a99cbce6e
CraftScoreboard(Scoreboard board) {
this.board = board;
-@@ -66,6 +67,12 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
+@@ -45,6 +46,12 @@ 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);
+ }
+@@ -66,6 +73,12 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
Validate.isTrue(board.getObjective(name) == null, "An objective of name '" + name + "' already exists");
CraftCriteria craftCriteria = CraftCriteria.getFromBukkit(criteria);