Class TeamPlayer

java.lang.Object
com.booksaw.betterTeams.TeamPlayer

public class TeamPlayer extends Object
This class is used to store all the information about a user in a team
Author:
booksaw
  • 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 object
      rank - 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

      public TeamPlayer(@NotNull @NotNull String data)
      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

      public Optional<org.bukkit.entity.Player> getOnlinePlayer()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isInTeamChat

      public boolean isInTeamChat()
    • isInAllyChat

      public boolean isInAllyChat()
    • isAnchored

      public boolean isAnchored()
    • getPrefix

      public String getPrefix(org.bukkit.ChatColor returnTo)
      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

      public UUID getPlayerUUID()
      this is used to store the player that the object is associated with
    • setRank

      public void setRank(PlayerRank rank)
      The rank of the player within their team
    • getRank

      public PlayerRank 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

      public void setTitle(String title)
      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

      public String 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)