From 71ca5a7bdff07f0f01f16cf108b24dc3c7e36c6b Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 5 Jan 2024 14:18:13 +1100 Subject: [PATCH] SPIGOT-7562: Fix Score#getScore and Score#isScoreSet By: md_5 --- .../org/bukkit/craftbukkit/scoreboard/CraftScore.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java b/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java index a804b360ea..2c11f70d06 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java @@ -42,11 +42,9 @@ final class CraftScore implements Score { public int getScore() { Scoreboard board = objective.checkState().board; - if (board.getTrackedPlayers().contains(entry)) { // Lazy - ReadOnlyScoreInfo score = board.getPlayerScoreInfo(entry, objective.getHandle()); - if (score != null) { // Lazy - return score.value(); - } + ReadOnlyScoreInfo score = board.getPlayerScoreInfo(entry, objective.getHandle()); + if (score != null) { // Lazy + return score.value(); } return 0; // Lazy @@ -61,7 +59,7 @@ final class CraftScore implements Score { public boolean isScoreSet() { Scoreboard board = objective.checkState().board; - return board.getTrackedPlayers().contains(entry) && board.getPlayerScoreInfo(entry, objective.getHandle()) != null; + return board.getPlayerScoreInfo(entry, objective.getHandle()) != null; } @Override