Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
Team.java
1 package org.bukkit.scoreboard;
2 
3 import java.util.Set;
4 
7 
8 /**
9  * A team on a scoreboard that has a common display theme and other
10  * properties. This team is only relevant to the display of the associated
11  * {@link #getScoreboard() scoreboard}.
12  */
13 public interface Team {
14 
15  /**
16  * Gets the name of this Team
17  *
18  * @return Objective name
19  * @throws IllegalStateException if this team has been unregistered
20  */
21  String getName() throws IllegalStateException;
22 
23  /**
24  * Gets the name displayed to players for this team
25  *
26  * @return Team display name
27  * @throws IllegalStateException if this team has been unregistered
28  */
29  String getDisplayName() throws IllegalStateException;
30 
31  /**
32  * Sets the name displayed to players for this team
33  *
34  * @param displayName New display name
35  * @throws IllegalArgumentException if displayName is longer than 32
36  * characters.
37  * @throws IllegalStateException if this team has been unregistered
38  */
39  void setDisplayName(String displayName) throws IllegalStateException, IllegalArgumentException;
40 
41  /**
42  * Gets the prefix prepended to the display of players on this team.
43  *
44  * @return Team prefix
45  * @throws IllegalStateException if this team has been unregistered
46  */
47  String getPrefix() throws IllegalStateException;
48 
49  /**
50  * Sets the prefix prepended to the display of players on this team.
51  *
52  * @param prefix New prefix
53  * @throws IllegalArgumentException if prefix is null
54  * @throws IllegalArgumentException if prefix is longer than 16
55  * characters
56  * @throws IllegalStateException if this team has been unregistered
57  */
58  void setPrefix(String prefix) throws IllegalStateException, IllegalArgumentException;
59 
60  /**
61  * Gets the suffix appended to the display of players on this team.
62  *
63  * @return the team's current suffix
64  * @throws IllegalStateException if this team has been unregistered
65  */
66  String getSuffix() throws IllegalStateException;
67 
68  /**
69  * Sets the suffix appended to the display of players on this team.
70  *
71  * @param suffix the new suffix for this team.
72  * @throws IllegalArgumentException if suffix is null
73  * @throws IllegalArgumentException if suffix is longer than 16
74  * characters
75  * @throws IllegalStateException if this team has been unregistered
76  */
77  void setSuffix(String suffix) throws IllegalStateException, IllegalArgumentException;
78 
79  /**
80  * Gets the team friendly fire state
81  *
82  * @return true if friendly fire is enabled
83  * @throws IllegalStateException if this team has been unregistered
84  */
85  boolean allowFriendlyFire() throws IllegalStateException;
86 
87  /**
88  * Sets the team friendly fire state
89  *
90  * @param enabled true if friendly fire is to be allowed
91  * @throws IllegalStateException if this team has been unregistered
92  */
93  void setAllowFriendlyFire(boolean enabled) throws IllegalStateException;
94 
95  /**
96  * Gets the team's ability to see {@link PotionEffectType#INVISIBILITY
97  * invisible} teammates.
98  *
99  * @return true if team members can see invisible members
100  * @throws IllegalStateException if this team has been unregistered
101  */
102  boolean canSeeFriendlyInvisibles() throws IllegalStateException;
103 
104  /**
105  * Sets the team's ability to see {@link PotionEffectType#INVISIBILITY
106  * invisible} teammates.
107  *
108  * @param enabled true if invisible teammates are to be visible
109  * @throws IllegalStateException if this team has been unregistered
110  */
111  void setCanSeeFriendlyInvisibles(boolean enabled) throws IllegalStateException;
112 
113  /**
114  * Gets the Set of players on the team
115  *
116  * @return players on the team
117  * @throws IllegalStateException if this team has been unregistered
118  */
119  Set<OfflinePlayer> getPlayers() throws IllegalStateException;
120 
121  /**
122  * Gets the size of the team
123  *
124  * @return number of players on the team
125  * @throws IllegalStateException if this team has been unregistered
126  */
127  int getSize() throws IllegalStateException;
128 
129  /**
130  * Gets the Scoreboard to which this team is attached
131  *
132  * @return Owning scoreboard, or null if this team has been {@link
133  * #unregister() unregistered}
134  */
136 
137  /**
138  * This puts the specified player onto this team for the scoreboard.
139  * <p>
140  * This will remove the player from any other team on the scoreboard.
141  *
142  * @param player the player to add
143  * @throws IllegalArgumentException if player is null
144  * @throws IllegalStateException if this team has been unregistered
145  */
146  void addPlayer(OfflinePlayer player) throws IllegalStateException, IllegalArgumentException;
147 
148  /**
149  * Removes the player from this team.
150  *
151  * @param player the player to remove
152  * @return if the player was on this team
153  * @throws IllegalArgumentException if player is null
154  * @throws IllegalStateException if this team has been unregistered
155  */
156  boolean removePlayer(OfflinePlayer player) throws IllegalStateException, IllegalArgumentException;
157 
158  /**
159  * Unregisters this team from the Scoreboard
160  *
161  * @throws IllegalStateException if this team has been unregistered
162  */
163  void unregister() throws IllegalStateException;
164 
165  /**
166  * Checks to see if the specified player is a member of this team.
167  *
168  * @param player the player to search for
169  * @return true if the player is a member of this team
170  * @throws IllegalArgumentException if player is null
171  * @throws IllegalStateException if this team has been unregistered
172  */
173  boolean hasPlayer(OfflinePlayer player) throws IllegalArgumentException, IllegalStateException;
174 }
boolean hasPlayer(OfflinePlayer player)
void setCanSeeFriendlyInvisibles(boolean enabled)
void setSuffix(String suffix)
void addPlayer(OfflinePlayer player)
boolean canSeeFriendlyInvisibles()
Set< OfflinePlayer > getPlayers()
void setPrefix(String prefix)
void setDisplayName(String displayName)
boolean removePlayer(OfflinePlayer player)
void setAllowFriendlyFire(boolean enabled)