From 648dd6e32f2487e6cbc98720627831533b63e0b8 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 10 Nov 2017 10:50:58 +1100 Subject: [PATCH] Add Score.isScoreSet()Z API. By: md_5 --- .../java/org/bukkit/craftbukkit/scoreboard/CraftScore.java | 7 +++++++ 1 file changed, 7 insertions(+) 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 d3ae91bc03..f378113cec 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 @@ -56,6 +56,13 @@ final class CraftScore implements Score { objective.checkState().board.getPlayerScoreForObjective(entry, objective.getHandle()).setScore(score); } + @Override + public boolean isScoreSet() throws IllegalStateException { + Scoreboard board = objective.checkState().board; + + return board.getPlayers().contains(entry) && board.getPlayerObjectives(entry).containsKey(objective.getHandle()); + } + public CraftScoreboard getScoreboard() { return objective.getScoreboard(); }