summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2017-11-10 10:50:58 +1100
committermd_5 <git@md-5.net>2017-11-10 10:50:58 +1100
commit25959fab20e05505c11e7d46d9baf96db57b2b32 (patch)
treed117d413da54cd336f38faf8a5a0aaa6024e4025
parent353964045a14a76bb83f67626af21c7b593e29e2 (diff)
downloadcraftbukkit-25959fab20e05505c11e7d46d9baf96db57b2b32.tar
craftbukkit-25959fab20e05505c11e7d46d9baf96db57b2b32.tar.gz
craftbukkit-25959fab20e05505c11e7d46d9baf96db57b2b32.tar.lz
craftbukkit-25959fab20e05505c11e7d46d9baf96db57b2b32.tar.xz
craftbukkit-25959fab20e05505c11e7d46d9baf96db57b2b32.zip
Add Score.isScoreSet()Z API.
-rw-r--r--src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java7
1 files changed, 7 insertions, 0 deletions
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();
}