Class ClanPlayer

java.lang.Object
net.sacredlabyrinth.phaed.simpleclans.ClanPlayer
All Implemented Interfaces:
Serializable, Comparable<ClanPlayer>

public class ClanPlayer extends Object implements Serializable, Comparable<ClanPlayer>
Author:
phaed
See Also:
  • Constructor Details

    • ClanPlayer

      public ClanPlayer()
    • ClanPlayer

      @Deprecated public ClanPlayer(String playerName)
      Deprecated.
    • ClanPlayer

      public ClanPlayer(UUID uuid)
      Parameters:
      uuid - the Player's UUID
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(ClanPlayer other)
      Specified by:
      compareTo in interface Comparable<ClanPlayer>
    • toString

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

      public String getName()
      (used internally)
      Returns:
      the name
    • getUniqueId

      public UUID getUniqueId()
      (used internally)
      Returns:
      the uniqueId
    • getCleanName

      public String getCleanName()
      Returns the clean name for this player (lowercase)
      Returns:
      the name
    • setName

      public void setName(String name)
      (used internally)
      Parameters:
      name - the name to set
    • setUniqueId

      public void setUniqueId(UUID uniqueId)
      (used internally)
      Parameters:
      uniqueId - the name to set
    • isLeader

      public boolean isLeader()
      Whether this player is a leader or not
      Returns:
      the leader
    • setLeader

      public void setLeader(boolean leader)
      Sets this player as a leader (does not update clanplayer to db)
      Parameters:
      leader - the leader to set
    • isAlly

      public boolean isAlly(org.bukkit.entity.Player player)
      Check whether the player is an ally with another player
    • isRival

      public boolean isRival(org.bukkit.entity.Player player)
      Check whether the player is an rival with another player
    • getLastSeen

      public long getLastSeen()
      Returns the last seen date for this player in milliseconds
      Returns:
      the lastSeen
    • setLastSeen

      public void setLastSeen(long lastSeen)
      (used internally)
      Parameters:
      lastSeen - the lastSeen to set
    • updateLastSeen

      public void updateLastSeen()
      Updates last seen date to today
    • getLastSeenDaysString

      public String getLastSeenDaysString()
      Returns:
      a verbal representation of how many days ago a player was last seen
    • getLastSeenDaysString

      public String getLastSeenDaysString(@Nullable @Nullable org.bukkit.command.CommandSender sender)
      Parameters:
      sender - the Player viewing the last seen days
      Returns:
      a verbal representation of how many days ago a player was last seen
    • getLastSeenDaysString

      public String getLastSeenDaysString(@Nullable @Nullable org.bukkit.entity.Player viewer)
    • getLastSeenDays

      public double getLastSeenDays()
      Returns number of days since the player was last seen
    • getTotalKills

      public int getTotalKills()
    • getRivalKills

      public int getRivalKills()
      Returns the number of rival kills this player has
      Returns:
      the rivalKills
    • setRivalKills

      public void setRivalKills(int rivalKills)
      (used internally)
      Parameters:
      rivalKills - the rivalKills to set
    • addRivalKill

      @Deprecated public void addRivalKill()
      Deprecated.
      Adds one rival kill to this player (does not update clanplayer to db)
    • getCivilianKills

      public int getCivilianKills()
      Returns the number of civilian kills this player has
      Returns:
      the civilianKills
    • setCivilianKills

      public void setCivilianKills(int civilianKills)
      (used internally)
      Parameters:
      civilianKills - the civilianKills to set
    • addCivilianKill

      @Deprecated public void addCivilianKill()
      Deprecated.
      Adds one civilian kill to this player (does not update clanplayer to db)
    • getNeutralKills

      public int getNeutralKills()
      Returns the number of neutral kills this player has
      Returns:
      the neutralKills
    • setNeutralKills

      public void setNeutralKills(int neutralKills)
      (used internally)
      Parameters:
      neutralKills - the neutralKills to set
    • addNeutralKill

      @Deprecated public void addNeutralKill()
      Deprecated.
      Adds one civilian kill to this player (does not update clanplayer to db)
    • setAllyKills

      public void setAllyKills(int allyKills)
    • getAllyKills

      public int getAllyKills()
    • addKill

      public void addKill(Kill.Type type)
      Adds one kill to this player (does not update to db)
    • isFriendlyFire

      public boolean isFriendlyFire()
      Whether this player is allowing friendly fire
      Returns:
      the friendlyFire
    • setFriendlyFire

      public void setFriendlyFire(boolean friendlyFire)
      Sets whether this player is allowing friendly fire (does not update clanplayer to db)
      Parameters:
      friendlyFire - the friendlyFire to set
    • getVote

      @Nullable public @Nullable VoteResult getVote()
      (used internally)
      Returns:
      the vote
    • setVote

      public void setVote(@Nullable @Nullable VoteResult vote)
      (used internally)
      Parameters:
      vote - the vote to set
    • getDeaths

      public int getDeaths()
      Returns the number of deaths this player has
      Returns:
      the deaths
    • setDeaths

      public void setDeaths(int deaths)
      (used internally)
      Parameters:
      deaths - the deaths to set
    • addDeath

      public void addDeath()
      Adds one death to this player (does not update clanplayer to db)
    • getWeightedKills

      public double getWeightedKills()
      Returns weighted kill score for this player (kills multiplied by the different weights)
    • getKDR

      public float getKDR()
      Returns weighted-kill/death ratio
    • getJoinDate

      public long getJoinDate()
      Returns the player's join date to his current clan in milliseconds, 0 if not in a clan
      Returns:
      the joinDate
    • setJoinDate

      public void setJoinDate(long joinDate)
      (used internally)
      Parameters:
      joinDate - the joinDate to set
    • getJoinDateString

      public String getJoinDateString()
      Returns a string representation of the join date, blank if not in a clan
    • getLastSeenString

      @NotNull public @NotNull String getLastSeenString()
      Returns:
      a string representation of the last seen date
    • getLastSeenString

      public String getLastSeenString(@Nullable @Nullable org.bukkit.entity.Player viewer)
      Parameters:
      viewer - the Player viewing the last seen
      Returns:
      a string representation of the last seen date
    • getLastSeenString

      public String getLastSeenString(@Nullable @Nullable org.bukkit.command.CommandSender sender)
    • getInactiveDays

      public int getInactiveDays()
      Returns the number of days the player has been inactive
    • getPackedPastClans

      public String getPackedPastClans()
      (used internally)
      Returns:
      the PackedPastClans
    • setPackedPastClans

      public void setPackedPastClans(String packedPastClans)
      (used internally)
      Parameters:
      packedPastClans - the packedPastClans to set
    • addPastClan

      public void addPastClan(String tag)
      Adds a past clan to the player (does not update the clanplayer to db)
    • removePastClan

      public void removePastClan(String tag)
      Removes a past clan from the player (does not update the clanplayer to db)
      Parameters:
      tag - is the clan's colored tag
    • getPastClansString

      @NotNull public @NotNull String getPastClansString(@NotNull @NotNull String sep)
      Parameters:
      sep - the separator
      Returns:
      a separator delimited string with the color tags for all past clans this player has been in
    • getPastClansString

      @NotNull public @NotNull String getPastClansString(String sep, @Nullable @Nullable org.bukkit.entity.Player viewer)
      Parameters:
      sep - the separator
      viewer - the Player viewing the clan's string
      Returns:
      a separator delimited string with the color tags for all past clans this player has been in
    • getPastClans

      public Set<String> getPastClans()
      Returns a list with all past clans color tags this player has been in
      Returns:
      the pastClans
    • getResignTimes

      public Map<String,Long> getResignTimes()
      Returns a map containing the time the player resigned from certain clans
      Returns:
      the resign times
    • getResignTime

      public Long getResignTime(String tag)
      Returns the time in millis when the player resigned from the clan
      Returns:
      the time in millis
    • setResignTimes

      public void setResignTimes(@Nullable @Nullable Map<String,Long> resignTimes)
      Sets the resign times (does not update to db)
    • addResignTime

      public void addResignTime(String tag)
      Adds the clan to the resign times map
    • getClan

      @Nullable public @Nullable Clan getClan()
      Returns this player's clan
      Returns:
      the clan
    • setClan

      public void setClan(@Nullable @Nullable Clan clan)
      (used internally)
      Parameters:
      clan - the clan to set
    • getTag

      public String getTag()
      Returns this player's clan's tag. Empty string if he's not in a clan.
      Returns:
      the tag
    • getTagLabel

      public String getTagLabel()
      Returns this player's clan's tag label. Empty string if he's not in a clan.
      Returns:
      the tag
    • isTrusted

      public boolean isTrusted()
      Returns this player's trusted status
      Returns:
      the trusted
    • setTrusted

      public void setTrusted(boolean trusted)
      Sets this player's trusted status (does not update the clanplayer to db)
      Parameters:
      trusted - the trusted to set
    • getFlags

      public String getFlags()
      Return the list of flags and their data as a json string
      Returns:
      the flags
    • setFlags

      public void setFlags(String flagString)
      Read the list of flags in from a json string
      Parameters:
      flagString - the flags to set
    • getChannel

      @NotNull public @NotNull ClanPlayer.Channel getChannel()
    • isGlobalChat

      @Deprecated public boolean isGlobalChat()
      Deprecated.
    • isAllyChat

      @Deprecated public boolean isAllyChat()
      Deprecated.
    • isClanChat

      @Deprecated public boolean isClanChat()
      Deprecated.
    • setGlobalChat

      @Deprecated public void setGlobalChat(boolean globalChat)
      Deprecated.
    • setAllyChat

      @Deprecated public void setAllyChat(boolean allyChat)
      Deprecated.
    • setClanChat

      @Deprecated public void setClanChat(boolean clanChat)
      Deprecated.
    • setChannel

      public void setChannel(@NotNull @NotNull ClanPlayer.Channel channel)
    • isBbEnabled

      public boolean isBbEnabled()
    • setBbEnabled

      public void setBbEnabled(boolean bbEnabled)
    • isInviteEnabled

      public boolean isInviteEnabled()
    • setInviteEnabled

      public void setInviteEnabled(boolean inviteEnabled)
    • isCapeEnabled

      @Deprecated public boolean isCapeEnabled()
      Deprecated.
    • setCapeEnabled

      @Deprecated public void setCapeEnabled(boolean capeEnabled)
      Deprecated.
    • isTagEnabled

      public boolean isTagEnabled()
    • setTagEnabled

      public void setTagEnabled(boolean tagEnabled)
    • isUseChatShortcut

      @Deprecated public boolean isUseChatShortcut()
      Deprecated.
    • getRankDisplayName

      public String getRankDisplayName()
    • hasRank

      public boolean hasRank()
    • getRankId

      @NotNull public @NotNull String getRankId()
    • getRank

      @Deprecated public String getRank()
      Deprecated.
      Gets the rank displayname
    • setRank

      public void setRank(@Nullable @Nullable String rank)
      Sets the rank id
      Parameters:
      rank - the rank id
    • getLocale

      @Nullable public @Nullable Locale getLocale()
    • setLocale

      public void setLocale(@Nullable @Nullable Locale locale)
    • toPlayer

      @Nullable public @Nullable org.bukkit.entity.Player toPlayer()
    • mute

      public void mute(ClanPlayer.Channel channel, boolean b)
    • setMuted

      @Deprecated public void setMuted(boolean b)
      Deprecated.
    • setMutedAlly

      @Deprecated public void setMutedAlly(boolean b)
      Deprecated.
    • isMuted

      public boolean isMuted()
    • isMutedAlly

      public boolean isMutedAlly()
    • disallow

      public void disallow(@NotNull @NotNull ProtectionManager.Action action, @NotNull @NotNull String landId)
    • allow

      public void allow(@NotNull @NotNull ProtectionManager.Action action, @NotNull @NotNull String landId)
    • isAllowed

      public boolean isAllowed(@NotNull @NotNull ProtectionManager.Action action, @NotNull @NotNull String landId)