Package com.booksaw.betterTeams
Class TeamPlayer
java.lang.Object
com.booksaw.betterTeams.TeamPlayer
This class is used to store all the information about a user in a team
- Author:
- booksaw
-
Constructor Summary
ConstructorsConstructorDescriptionTeamPlayer
(@NotNull String data) Used to load player information relating to that playerTeamPlayer
(@NotNull org.bukkit.OfflinePlayer player, @Nullable PlayerRank rank) Used to create a new playerTeamPlayer
(@NotNull org.bukkit.OfflinePlayer player, @Nullable PlayerRank rank, @Nullable String title) TeamPlayer
(@NotNull org.bukkit.OfflinePlayer player, @Nullable PlayerRank rank, @Nullable String title, boolean anchor) -
Method Summary
Modifier and TypeMethodDescriptionOptional<org.bukkit.entity.Player>
org.bukkit.OfflinePlayer
this is used to store the player that the object is associated withgetPrefix
(org.bukkit.ChatColor returnTo) getRank()
The rank of the player within their teamgetTitle()
Do not use this method (only should be used in the class Team, instead use Team.setTitle() as that will save the updated value)boolean
boolean
boolean
boolean
isOnline()
Checks if the player associated with this TeamPlayer is currently online.void
setAllyChat
(boolean allyChat) void
setAnchor
(boolean anchor) void
setRank
(PlayerRank rank) The rank of the player within their teamvoid
setTeamChat
(boolean teamChat) This stores if the team is messaging to the team chat or the global chatvoid
Do not use this method (only should be used in the class Team, instead use Team.setTitle() as that will save the updated value)toString()
-
Constructor Details
-
TeamPlayer
public TeamPlayer(@NotNull @NotNull org.bukkit.OfflinePlayer player, @Nullable @Nullable PlayerRank rank) Used to create a new player- Parameters:
player
- the player that is associated with this objectrank
- the rank that the player has
-
TeamPlayer
public TeamPlayer(@NotNull @NotNull org.bukkit.OfflinePlayer player, @Nullable @Nullable PlayerRank rank, @Nullable @Nullable String title) -
TeamPlayer
public TeamPlayer(@NotNull @NotNull org.bukkit.OfflinePlayer player, @Nullable @Nullable PlayerRank rank, @Nullable @Nullable String title, boolean anchor) -
TeamPlayer
Used to load player information relating to that player- Parameters:
data
- the data for the player (uuid,rank,title)
-
-
Method Details
-
getPlayer
public org.bukkit.OfflinePlayer getPlayer()- Returns:
- The player which is associated with this object
-
getOnlinePlayer
-
toString
-
isInTeamChat
public boolean isInTeamChat() -
isInAllyChat
public boolean isInAllyChat() -
isAnchored
public boolean isAnchored() -
getPrefix
- Parameters:
returnTo
- the chat color that should be returned to after the prefix has been added (to stop the color of the prefix continuing for the rest of the message)- Returns:
- the prefix for messages that the player has sent
-
isOnline
public boolean isOnline()Checks if the player associated with this TeamPlayer is currently online.- Returns:
- true if the player is online, false otherwise
-
getPlayerUUID
this is used to store the player that the object is associated with -
setRank
The rank of the player within their team -
getRank
The rank of the player within their team -
setTeamChat
public void setTeamChat(boolean teamChat) This stores if the team is messaging to the team chat or the global chat -
setAllyChat
public void setAllyChat(boolean allyChat) -
setTitle
Do not use this method (only should be used in the class Team, instead use Team.setTitle() as that will save the updated value) -
getTitle
Do not use this method (only should be used in the class Team, instead use Team.setTitle() as that will save the updated value) -
setAnchor
public void setAnchor(boolean anchor)
-