summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
index 72b02b07..ad65b3f8 100644
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
@@ -84,12 +84,28 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
return scores.build();
}
+ public ImmutableSet<Score> getScores(String entry) throws IllegalArgumentException {
+ Validate.notNull(entry, "Entry cannot be null");
+
+ ImmutableSet.Builder<Score> scores = ImmutableSet.builder();
+ for (CraftObjective objective : objectives.values()) {
+ scores.add(objective.getScore(entry));
+ }
+ return scores.build();
+ }
+
public void resetScores(OfflinePlayer player) throws IllegalArgumentException {
Validate.notNull(player, "OfflinePlayer cannot be null");
board.resetPlayerScores(player.getName());
}
+ public void resetScores(String entry) throws IllegalArgumentException {
+ Validate.notNull(entry, "Entry cannot be null");
+
+ board.resetPlayerScores(entry);
+ }
+
public Team getPlayerTeam(OfflinePlayer player) throws IllegalArgumentException {
Validate.notNull(player, "OfflinePlayer cannot be null");
@@ -123,6 +139,14 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
return players.build();
}
+ public ImmutableSet<String> getEntries() {
+ ImmutableSet.Builder<String> entries = ImmutableSet.builder();
+ for (Object entry : board.getPlayers()) {
+ entries.add(entry.toString());
+ }
+ return entries.build();
+ }
+
public void clearSlot(DisplaySlot slot) throws IllegalArgumentException {
Validate.notNull(slot, "Slot cannot be null");
board.setDisplaySlot(CraftScoreboardTranslations.fromBukkitSlot(slot), null);