接口 Team
public interface Team
A team on a scoreboard that has a common display theme and other
properties. This team is only relevant to the display of the associated
scoreboard
.-
嵌套类概要
修饰符和类型接口说明static enum
Represents an option which may be applied to this team.static enum
How an option may be applied to members of this team. -
方法概要
修饰符和类型方法说明void
This puts the specified entry onto this team for the scoreboard.void
addPlayer
(OfflinePlayer player) 已过时。Teams can contain entries that aren't playersboolean
Gets the team friendly fire stateboolean
Gets the team's ability to seeinvisible
teammates.getColor()
Gets the color of the team.Gets the name displayed to entries for this teamGets the Set of entries on the teamgetName()
Gets the name of this TeamgetOption
(Team.Option option) Get an option for this team已过时。Teams can contain entries that aren't playersGets the prefix prepended to the display of entries on this team.Gets the Scoreboard to which this team is attachedint
getSize()
Gets the size of the teamGets the suffix appended to the display of entries on this team.boolean
Checks to see if the specified entry is a member of this team.boolean
hasPlayer
(OfflinePlayer player) 已过时。Teams can contain entries that aren't playersboolean
removeEntry
(String entry) Removes the entry from this team.boolean
removePlayer
(OfflinePlayer player) 已过时。Teams can contain entries that aren't playersvoid
setAllowFriendlyFire
(boolean enabled) Sets the team friendly fire statevoid
setCanSeeFriendlyInvisibles
(boolean enabled) Sets the team's ability to seeinvisible
teammates.void
Sets the color of the team.void
setDisplayName
(String displayName) Sets the name displayed to entries for this teamvoid
setNameTagVisibility
(NameTagVisibility visibility) void
setOption
(Team.Option option, Team.OptionStatus status) Set an option for this teamvoid
Sets the prefix prepended to the display of entries on this team.void
Sets the suffix appended to the display of entries on this team.void
Unregisters this team from the Scoreboard
-
方法详细资料
-
getName
Gets the name of this Team- 返回:
- Objective name
- 抛出:
IllegalStateException
- if this team has been unregistered
-
getDisplayName
Gets the name displayed to entries for this team- 返回:
- Team display name
- 抛出:
IllegalStateException
- if this team has been unregistered
-
setDisplayName
Sets the name displayed to entries for this team- 参数:
displayName
- New display name- 抛出:
IllegalArgumentException
- if displayName is longer than 32 characters.IllegalStateException
- if this team has been unregistered
-
getPrefix
Gets the prefix prepended to the display of entries on this team.- 返回:
- Team prefix
- 抛出:
IllegalStateException
- if this team has been unregistered
-
setPrefix
Sets the prefix prepended to the display of entries on this team.- 参数:
prefix
- New prefix- 抛出:
IllegalArgumentException
- if prefix is nullIllegalArgumentException
- if prefix is longer than 16 charactersIllegalStateException
- if this team has been unregistered
-
getSuffix
Gets the suffix appended to the display of entries on this team.- 返回:
- the team's current suffix
- 抛出:
IllegalStateException
- if this team has been unregistered
-
setSuffix
Sets the suffix appended to the display of entries on this team.- 参数:
suffix
- the new suffix for this team.- 抛出:
IllegalArgumentException
- if suffix is nullIllegalArgumentException
- if suffix is longer than 16 charactersIllegalStateException
- if this team has been unregistered
-
getColor
Gets the color of the team.
This only sets the team outline, other occurrences of colors such as in names are handled by prefixes / suffixes.- 返回:
- team color, defaults to
ChatColor.RESET
- 抛出:
IllegalStateException
-
setColor
Sets the color of the team.
This only sets the team outline, other occurrences of colors such as in names are handled by prefixes / suffixes.- 参数:
color
- new color, must be non-null. UseChatColor.RESET
for no color
-
allowFriendlyFire
Gets the team friendly fire state- 返回:
- true if friendly fire is enabled
- 抛出:
IllegalStateException
- if this team has been unregistered
-
setAllowFriendlyFire
Sets the team friendly fire state- 参数:
enabled
- true if friendly fire is to be allowed- 抛出:
IllegalStateException
- if this team has been unregistered
-
canSeeFriendlyInvisibles
Gets the team's ability to seeinvisible
teammates.- 返回:
- true if team members can see invisible members
- 抛出:
IllegalStateException
- if this team has been unregistered
-
setCanSeeFriendlyInvisibles
Sets the team's ability to seeinvisible
teammates.- 参数:
enabled
- true if invisible teammates are to be visible- 抛出:
IllegalStateException
- if this team has been unregistered
-
getNameTagVisibility
Gets the team's ability to see name tags- 返回:
- the current name tag visibility for the team
- 抛出:
IllegalArgumentException
- if this team has been unregistered
-
setNameTagVisibility
Set's the team's ability to see name tags- 参数:
visibility
- The nameTagVisibilty to set- 抛出:
IllegalArgumentException
- if this team has been unregistered
-
getPlayers
已过时。Teams can contain entries that aren't playersGets the Set of players on the team- 返回:
- players on the team
- 抛出:
IllegalStateException
- if this team has been unregistered\- 另请参阅:
-
getEntries
Gets the Set of entries on the team- 返回:
- entries on the team
- 抛出:
IllegalStateException
- if this entries has been unregistered\
-
getSize
Gets the size of the team- 返回:
- number of entries on the team
- 抛出:
IllegalStateException
- if this team has been unregistered
-
getScoreboard
Scoreboard getScoreboard()Gets the Scoreboard to which this team is attached- 返回:
- Owning scoreboard, or null if this team has been
unregistered
-
addPlayer
@Deprecated void addPlayer(OfflinePlayer player) throws IllegalStateException, IllegalArgumentException 已过时。Teams can contain entries that aren't playersThis puts the specified player onto this team for the scoreboard.This will remove the player from any other team on the scoreboard.
- 参数:
player
- the player to add- 抛出:
IllegalArgumentException
- if player is nullIllegalStateException
- if this team has been unregistered- 另请参阅:
-
addEntry
This puts the specified entry onto this team for the scoreboard.This will remove the entry from any other team on the scoreboard.
- 参数:
entry
- the entry to add- 抛出:
IllegalArgumentException
- if entry is nullIllegalStateException
- if this team has been unregistered
-
removePlayer
@Deprecated boolean removePlayer(OfflinePlayer player) throws IllegalStateException, IllegalArgumentException 已过时。Teams can contain entries that aren't playersRemoves the player from this team.- 参数:
player
- the player to remove- 返回:
- if the player was on this team
- 抛出:
IllegalArgumentException
- if player is nullIllegalStateException
- if this team has been unregistered- 另请参阅:
-
removeEntry
Removes the entry from this team.- 参数:
entry
- the entry to remove- 返回:
- if the entry was a part of this team
- 抛出:
IllegalArgumentException
- if entry is nullIllegalStateException
- if this team has been unregistered
-
unregister
Unregisters this team from the Scoreboard- 抛出:
IllegalStateException
- if this team has been unregistered
-
hasPlayer
@Deprecated boolean hasPlayer(OfflinePlayer player) throws IllegalArgumentException, IllegalStateException 已过时。Teams can contain entries that aren't playersChecks to see if the specified player is a member of this team.- 参数:
player
- the player to search for- 返回:
- true if the player is a member of this team
- 抛出:
IllegalArgumentException
- if player is nullIllegalStateException
- if this team has been unregistered- 另请参阅:
-
hasEntry
Checks to see if the specified entry is a member of this team.- 参数:
entry
- the entry to search for- 返回:
- true if the entry is a member of this team
- 抛出:
IllegalArgumentException
- if entry is nullIllegalStateException
- if this team has been unregistered
-
getOption
Get an option for this team- 参数:
option
- the option to get- 返回:
- the option status
- 抛出:
IllegalStateException
- if this team has been unregistered
-
setOption
Set an option for this team- 参数:
option
- the option to setstatus
- the new option status- 抛出:
IllegalStateException
- if this team has been unregistered
-