From 25959fab20e05505c11e7d46d9baf96db57b2b32 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 10 Nov 2017 10:50:58 +1100 Subject: Add Score.isScoreSet()Z API. --- src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java index d3ae91bc..f378113c 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java +++ b/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(); } -- cgit v1.2.3