3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 02:50:09 +01:00
Paper/CraftBukkit-Patches/0097-Add-Score.isScoreSet-Z-API.patch
2016-03-03 03:46:48 -06:00

26 Zeilen
996 B
Diff

From dbe1a9c8b20c63f36dfb01ae9d613e95bdf9f87e Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Thu, 17 Apr 2014 19:35:53 +1000
Subject: [PATCH] Add Score.isScoreSet()Z API.
Also fix generics on CraftScore.getScore()I.
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java
index 0b71b53..ee9d2ae 100644
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java
@@ -63,7 +63,9 @@ final class CraftScore implements Score {
// Spigot start
@Override
public boolean isScoreSet() throws IllegalStateException {
- throw new UnsupportedOperationException("Not supported yet.");
+ Scoreboard board = objective.checkState().board;
+
+ return board.getPlayers().contains(entry) && board.getPlayerObjectives(entry).containsKey(objective.getHandle());
}
// Spigot end
}
--
2.5.0