@NonnullByDefault public class PacketScoreboardTeam extends Object implements ScoreboardTeam
ScoreboardTeam using ProtocolLib.ScoreboardTeam.CollisionRule, ScoreboardTeam.NameTagVisibility| Constructor and Description |
|---|
PacketScoreboardTeam(String id,
String displayName)
Creates a new scoreboard team
|
PacketScoreboardTeam(String id,
String displayName,
boolean autoSubscribe)
Creates a new scoreboard team
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addPlayer(String player)
Adds a player to this team
|
ScoreboardTeam.CollisionRule |
getCollisionRule()
Gets the current collision rule setting
|
ChatColor |
getColor()
Gets the team color.
|
String |
getDisplayName()
Gets the current display name of this team
|
String |
getId()
Gets the id of this team
|
ScoreboardTeam.NameTagVisibility |
getNameTagVisibility()
Gets the current nametag visibility setting
|
Set<String> |
getPlayers()
Gets an immutable copy of the teams members
|
String |
getPrefix()
Gets the current prefix for this team
|
String |
getSuffix()
Gets the current suffix for this team
|
boolean |
hasPlayer(String player)
Returns true if the given player is a member of this team
|
boolean |
isAllowFriendlyFire()
Gets if friendly fire is allowed
|
boolean |
isCanSeeFriendlyInvisibles()
Gets if members of this team can see invisible members on the same team
|
boolean |
removePlayer(String player)
Removes a player from this team
|
void |
setAllowFriendlyFire(boolean allowFriendlyFire)
Lazily sets the friendly fire setting to new value and updates the teams subscribers
|
void |
setAutoSubscribe(boolean autoSubscribe)
Sets if players should be automatically subscribed to this team.
|
void |
setCanSeeFriendlyInvisibles(boolean canSeeFriendlyInvisibles)
Lazily sets the friendly invisibility setting to new value and updates the teams subscribers
|
void |
setCollisionRule(ScoreboardTeam.CollisionRule collisionRule)
Lazily sets the collision rule setting to new value and updates the teams subscribers
|
void |
setColor(ChatColor color)
Sets the teams color.
|
void |
setDisplayName(String displayName)
Lazily sets the display name to a new value and updates the teams subscribers
|
void |
setNameTagVisibility(ScoreboardTeam.NameTagVisibility nameTagVisibility)
Lazily sets the nametag visibility setting to new value and updates the teams subscribers
|
void |
setPrefix(String prefix)
Lazily sets the prefix to a new value and updates the teams subscribers
|
void |
setSuffix(String suffix)
Lazily sets the suffix to a new value and updates the teams subscribers
|
boolean |
shouldAutoSubscribe()
Gets if players should be automatically subscribed to this team.
|
void |
subscribe(Player player)
Subscribes a player to this team
|
void |
unsubscribe(Player player)
Unsubscribes a player from this team
|
void |
unsubscribe(Player player,
boolean fast)
Unsubscribes a player from this team
|
void |
unsubscribeAll()
Unsubscribes all players from this team
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddPlayer, hasPlayer, removePlayerpublic PacketScoreboardTeam(String id, String displayName, boolean autoSubscribe)
id - the id of this teamdisplayName - the initial display nameautoSubscribe - if players should be automatically subscribedpublic String getId()
ScoreboardTeamgetId in interface ScoreboardTeampublic boolean shouldAutoSubscribe()
ScoreboardTeamshouldAutoSubscribe in interface ScoreboardTeampublic void setAutoSubscribe(boolean autoSubscribe)
ScoreboardTeamsetAutoSubscribe in interface ScoreboardTeamautoSubscribe - if players should be automatically subscribedpublic String getDisplayName()
ScoreboardTeamgetDisplayName in interface ScoreboardTeampublic void setDisplayName(String displayName)
ScoreboardTeamsetDisplayName in interface ScoreboardTeamdisplayName - the new display namepublic String getPrefix()
ScoreboardTeamgetPrefix in interface ScoreboardTeampublic void setPrefix(String prefix)
ScoreboardTeamsetPrefix in interface ScoreboardTeamprefix - the new prefixpublic String getSuffix()
ScoreboardTeamgetSuffix in interface ScoreboardTeampublic void setSuffix(String suffix)
ScoreboardTeamsetSuffix in interface ScoreboardTeamsuffix - the new suffixpublic boolean isAllowFriendlyFire()
ScoreboardTeamisAllowFriendlyFire in interface ScoreboardTeampublic void setAllowFriendlyFire(boolean allowFriendlyFire)
ScoreboardTeamsetAllowFriendlyFire in interface ScoreboardTeamallowFriendlyFire - the new settingpublic boolean isCanSeeFriendlyInvisibles()
ScoreboardTeamisCanSeeFriendlyInvisibles in interface ScoreboardTeampublic void setCanSeeFriendlyInvisibles(boolean canSeeFriendlyInvisibles)
ScoreboardTeamsetCanSeeFriendlyInvisibles in interface ScoreboardTeamcanSeeFriendlyInvisibles - the new settingpublic ScoreboardTeam.NameTagVisibility getNameTagVisibility()
ScoreboardTeamgetNameTagVisibility in interface ScoreboardTeampublic void setNameTagVisibility(ScoreboardTeam.NameTagVisibility nameTagVisibility)
ScoreboardTeamsetNameTagVisibility in interface ScoreboardTeamnameTagVisibility - the new settingpublic ScoreboardTeam.CollisionRule getCollisionRule()
ScoreboardTeamgetCollisionRule in interface ScoreboardTeampublic void setCollisionRule(ScoreboardTeam.CollisionRule collisionRule)
ScoreboardTeamsetCollisionRule in interface ScoreboardTeamcollisionRule - the new settingpublic ChatColor getColor()
ScoreboardTeamChatColor.RESET by default.getColor in interface ScoreboardTeampublic void setColor(ChatColor color)
ScoreboardTeamsetColor in interface ScoreboardTeamcolor - the new colorpublic boolean addPlayer(String player)
ScoreboardTeamaddPlayer in interface ScoreboardTeamplayer - the player to addpublic boolean removePlayer(String player)
ScoreboardTeamremovePlayer in interface ScoreboardTeamplayer - the player to removepublic boolean hasPlayer(String player)
ScoreboardTeamhasPlayer in interface ScoreboardTeamplayer - the player to check forpublic Set<String> getPlayers()
ScoreboardTeamgetPlayers in interface ScoreboardTeampublic void subscribe(Player player)
ScoreboardTeamsubscribe in interface ScoreboardTeamplayer - the player to subscribepublic void unsubscribe(Player player)
ScoreboardTeamunsubscribe in interface ScoreboardTeamplayer - the player to unsubscribepublic void unsubscribe(Player player, boolean fast)
ScoreboardTeamunsubscribe in interface ScoreboardTeamplayer - the player to unsubscribefast - if true, the removal packet will not be sent (for use when the player is leaving)public void unsubscribeAll()
ScoreboardTeamunsubscribeAll in interface ScoreboardTeamCopyright © 2020. All rights reserved.