Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
Scoreboard.java
1 package org.bukkit.scoreboard;
2 
3 import java.util.Set;
4 
6 
7 /**
8  * A scoreboard
9  */
10 public interface Scoreboard {
11 
12  /**
13  * Registers an Objective on this Scoreboard
14  *
15  * @param name Name of the Objective
16  * @param criteria Criteria for the Objective
17  * @return The registered Objective
18  * @throws IllegalArgumentException if name is null
19  * @throws IllegalArgumentException if criteria is null
20  * @throws IllegalArgumentException if an objective by that name already
21  * exists
22  */
23  Objective registerNewObjective(String name, String criteria) throws IllegalArgumentException;
24 
25  /**
26  * Gets an Objective on this Scoreboard by name
27  *
28  * @param name Name of the Objective
29  * @return the Objective or null if it does not exist
30  * @throws IllegalArgumentException if name is null
31  */
32  Objective getObjective(String name) throws IllegalArgumentException;
33 
34  /**
35  * Gets all Objectives of a Criteria on the Scoreboard
36  *
37  * @param criteria Criteria to search by
38  * @return an immutable set of Objectives using the specified Criteria
39  */
40  Set<Objective> getObjectivesByCriteria(String criteria) throws IllegalArgumentException;
41 
42  /**
43  * Gets all Objectives on this Scoreboard
44  *
45  * @return An immutable set of all Objectives on this Scoreboard
46  */
47  Set<Objective> getObjectives();
48 
49  /**
50  * Gets the Objective currently displayed in a DisplaySlot on this
51  * Scoreboard
52  *
53  * @param slot The DisplaySlot
54  * @return the Objective currently displayed or null if nothing is
55  * displayed in that DisplaySlot
56  * @throws IllegalArgumentException if slot is null
57  */
58  Objective getObjective(DisplaySlot slot) throws IllegalArgumentException;
59 
60  /**
61  * Gets all scores for a player on this Scoreboard
62  *
63  * @param player the player whose scores are being retrieved
64  * @return immutable set of all scores tracked for the player
65  * @throws IllegalArgumentException if player is null
66  * @deprecated Scoreboards can contain entries that aren't players
67  * @see #getScores(String)
68  */
69  @Deprecated
70  Set<Score> getScores(OfflinePlayer player) throws IllegalArgumentException;
71 
72  /**
73  * Gets all scores for an entry on this Scoreboard
74  *
75  * @param entry the entry whose scores are being retrieved
76  * @return immutable set of all scores tracked for the entry
77  * @throws IllegalArgumentException if entry is null
78  */
79  Set<Score> getScores(String entry) throws IllegalArgumentException;
80 
81  /**
82  * Removes all scores for a player on this Scoreboard
83  *
84  * @param player the player to drop all current scores for
85  * @throws IllegalArgumentException if player is null
86  * @deprecated Scoreboards can contain entries that aren't players
87  * @see #resetScores(String)
88  */
89  @Deprecated
90  void resetScores(OfflinePlayer player) throws IllegalArgumentException;
91 
92  /**
93  * Removes all scores for an entry on this Scoreboard
94  *
95  * @param entry the entry to drop all current scores for
96  * @throws IllegalArgumentException if entry is null
97  */
98  void resetScores(String entry) throws IllegalArgumentException;
99 
100  /**
101  * Gets a player's Team on this Scoreboard
102  *
103  * @param player the player to search for
104  * @return the player's Team or null if the player is not on a team
105  * @throws IllegalArgumentException if player is null
106  */
107  Team getPlayerTeam(OfflinePlayer player) throws IllegalArgumentException;
108 
109  /**
110  * Gets a Team by name on this Scoreboard
111  *
112  * @param teamName Team name
113  * @return the matching Team or null if no matches
114  * @throws IllegalArgumentException if teamName is null
115  */
116  Team getTeam(String teamName) throws IllegalArgumentException;
117 
118  /**
119  * Gets all teams on this Scoreboard
120  *
121  * @return an immutable set of Teams
122  */
123  Set<Team> getTeams();
124 
125  /**
126  * Registers a Team on this Scoreboard
127  *
128  * @param name Team name
129  * @return registered Team
130  * @throws IllegalArgumentException if name is null
131  * @throws IllegalArgumentException if team by that name already exists
132  */
133  Team registerNewTeam(String name) throws IllegalArgumentException;
134 
135  /**
136  * Gets all players tracked by this Scoreboard
137  *
138  * @return immutable set of all tracked players
139  * @deprecated Scoreboards can contain entries that aren't players
140  * @see #getEntries()
141  */
142  @Deprecated
143  Set<OfflinePlayer> getPlayers();
144 
145  /**
146  * Gets all entries tracked by this Scoreboard
147  *
148  * @return immutable set of all tracked entries
149  */
150  Set<String> getEntries();
151 
152  /**
153  * Clears any objective in the specified slot.
154  *
155  * @param slot the slot to remove objectives
156  * @throws IllegalArgumentException if slot is null
157  */
158  void clearSlot(DisplaySlot slot) throws IllegalArgumentException;
159 }
Set< OfflinePlayer > getPlayers()
Objective registerNewObjective(String name, String criteria)
void resetScores(OfflinePlayer player)
Set< Objective > getObjectivesByCriteria(String criteria)
void clearSlot(DisplaySlot slot)
Team getPlayerTeam(OfflinePlayer player)
Set< Objective > getObjectives()
Set< Score > getScores(OfflinePlayer player)
Team getTeam(String teamName)
Team registerNewTeam(String name)
Objective getObjective(String name)