Class ClanPlayer
java.lang.Object
net.sacredlabyrinth.phaed.simpleclans.ClanPlayer
- All Implemented Interfaces:
Serializable,Comparable<ClanPlayer>
- Author:
- phaed
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.voidaddDeath()Adds one death to this player (does not update clanplayer to db)voidAdds one kill to this player (does not update to db)voidDeprecated.voidaddPastClan(String tag) Adds a past clan to the player (does not update the clanplayer to db)voidaddResignTime(String tag) Adds the clan to the resign times mapvoidDeprecated.voidallow(@NotNull ProtectionManager.Action action, @NotNull String landId) intcompareTo(ClanPlayer other) voiddisallow(@NotNull ProtectionManager.Action action, @NotNull String landId) booleanint@NotNull ClanPlayer.ChannelintReturns the number of civilian kills this player has@Nullable ClangetClan()Returns this player's clanReturns the clean name for this player (lowercase)intReturns the number of deaths this player hasgetFlags()Return the list of flags and their data as a json stringintReturns the number of days the player has been inactivelongReturns the player's join date to his current clan in milliseconds, 0 if not in a clanReturns a string representation of the join date, blank if not in a clanfloatgetKDR()Returns weighted-kill/death ratiolongReturns the last seen date for this player in millisecondsdoubleReturns number of days since the player was last seengetLastSeenDaysString(@Nullable org.bukkit.command.CommandSender sender) getLastSeenDaysString(@Nullable org.bukkit.entity.Player viewer) @NotNull StringgetLastSeenString(@Nullable org.bukkit.command.CommandSender sender) getLastSeenString(@Nullable org.bukkit.entity.Player viewer) @Nullable LocalegetName()(used internally)intReturns the number of neutral kills this player has(used internally)Returns a list with all past clans color tags this player has been in@NotNull StringgetPastClansString(@NotNull String sep) @NotNull StringgetPastClansString(String sep, @Nullable org.bukkit.entity.Player viewer) getRank()Deprecated.@NotNull StringgetResignTime(String tag) Returns the time in millis when the player resigned from the clanReturns a map containing the time the player resigned from certain clansintReturns the number of rival kills this player hasgetTag()Returns this player's clan's tag.Returns this player's clan's tag label.int(used internally)@Nullable VoteResultgetVote()(used internally)doubleReturns weighted kill score for this player (kills multiplied by the different weights)inthashCode()booleanhasRank()booleanisAllowed(@NotNull ProtectionManager.Action action, @NotNull String landId) booleanisAlly(org.bukkit.entity.Player player) Check whether the player is an ally with another playerbooleanDeprecated.booleanbooleanDeprecated.booleanDeprecated.booleanWhether this player is allowing friendly firebooleanDeprecated.booleanbooleanisLeader()Whether this player is a leader or notbooleanisMuted()booleanbooleanisRival(org.bukkit.entity.Player player) Check whether the player is an rival with another playerbooleanbooleanReturns this player's trusted statusbooleanDeprecated.voidmute(ClanPlayer.Channel channel, boolean b) voidremovePastClan(String tag) Removes a past clan from the player (does not update the clanplayer to db)voidsetAllyChat(boolean allyChat) Deprecated.voidsetAllyKills(int allyKills) voidsetBbEnabled(boolean bbEnabled) voidsetCapeEnabled(boolean capeEnabled) Deprecated.voidsetChannel(@NotNull ClanPlayer.Channel channel) voidsetCivilianKills(int civilianKills) (used internally)void(used internally)voidsetClanChat(boolean clanChat) Deprecated.voidsetDeaths(int deaths) (used internally)voidRead the list of flags in from a json stringvoidsetFriendlyFire(boolean friendlyFire) Sets whether this player is allowing friendly fire (does not update clanplayer to db)voidsetGlobalChat(boolean globalChat) Deprecated.voidsetInviteEnabled(boolean inviteEnabled) voidsetJoinDate(long joinDate) (used internally)voidsetLastSeen(long lastSeen) (used internally)voidsetLeader(boolean leader) Sets this player as a leader (does not update clanplayer to db)voidvoidsetMuted(boolean b) Deprecated.voidsetMutedAlly(boolean b) Deprecated.void(used internally)voidsetNeutralKills(int neutralKills) (used internally)voidsetPackedPastClans(String packedPastClans) (used internally)voidSets the rank idvoidsetResignTimes(@Nullable Map<String, Long> resignTimes) Sets the resign times (does not update to db)voidsetRivalKills(int rivalKills) (used internally)voidsetTagEnabled(boolean tagEnabled) voidsetTrusted(boolean trusted) Sets this player's trusted status (does not update the clanplayer to db)voidsetUniqueId(UUID uniqueId) (used internally)voidsetVote(@Nullable VoteResult vote) (used internally)@Nullable org.bukkit.entity.PlayertoPlayer()toString()voidUpdates last seen date to today
-
Constructor Details
-
ClanPlayer
public ClanPlayer() -
ClanPlayer
Deprecated. -
ClanPlayer
- Parameters:
uuid- the Player's UUID
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<ClanPlayer>
-
toString
-
getName
(used internally)- Returns:
- the name
-
getUniqueId
(used internally)- Returns:
- the uniqueId
-
getCleanName
Returns the clean name for this player (lowercase)- Returns:
- the name
-
setName
(used internally)- Parameters:
name- the name to set
-
setUniqueId
(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
- Returns:
- a verbal representation of how many days ago a player was last seen
-
getLastSeenDaysString
- Parameters:
sender- the Player viewing the last seen days- Returns:
- a verbal representation of how many days ago a player was last seen
-
getLastSeenDaysString
-
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.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.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.Adds one civilian kill to this player (does not update clanplayer to db) -
setAllyKills
public void setAllyKills(int allyKills) -
getAllyKills
public int getAllyKills() -
addKill
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
(used internally)- Returns:
- the vote
-
setVote
(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
Returns a string representation of the join date, blank if not in a clan -
getLastSeenString
- Returns:
- a string representation of the last seen date
-
getLastSeenString
- Parameters:
viewer- the Player viewing the last seen- Returns:
- a string representation of the last seen date
-
getLastSeenString
-
getInactiveDays
public int getInactiveDays()Returns the number of days the player has been inactive -
getPackedPastClans
(used internally)- Returns:
- the PackedPastClans
-
setPackedPastClans
(used internally)- Parameters:
packedPastClans- the packedPastClans to set
-
addPastClan
Adds a past clan to the player (does not update the clanplayer to db) -
removePastClan
Removes a past clan from the player (does not update the clanplayer to db)- Parameters:
tag- is the clan's colored tag
-
getPastClansString
- 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 separatorviewer- 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
Returns a list with all past clans color tags this player has been in- Returns:
- the pastClans
-
getResignTimes
Returns a map containing the time the player resigned from certain clans- Returns:
- the resign times
-
getResignTime
Returns the time in millis when the player resigned from the clan- Returns:
- the time in millis
-
setResignTimes
Sets the resign times (does not update to db) -
addResignTime
Adds the clan to the resign times map -
getClan
Returns this player's clan- Returns:
- the clan
-
setClan
(used internally)- Parameters:
clan- the clan to set
-
getTag
Returns this player's clan's tag. Empty string if he's not in a clan.- Returns:
- the tag
-
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
Return the list of flags and their data as a json string- Returns:
- the flags
-
setFlags
Read the list of flags in from a json string- Parameters:
flagString- the flags to set
-
getChannel
-
isGlobalChat
Deprecated. -
isAllyChat
Deprecated. -
isClanChat
Deprecated. -
setGlobalChat
Deprecated. -
setAllyChat
Deprecated. -
setClanChat
Deprecated. -
setChannel
-
isBbEnabled
public boolean isBbEnabled() -
setBbEnabled
public void setBbEnabled(boolean bbEnabled) -
isInviteEnabled
public boolean isInviteEnabled() -
setInviteEnabled
public void setInviteEnabled(boolean inviteEnabled) -
isCapeEnabled
Deprecated. -
setCapeEnabled
Deprecated. -
isTagEnabled
public boolean isTagEnabled() -
setTagEnabled
public void setTagEnabled(boolean tagEnabled) -
isUseChatShortcut
Deprecated. -
getRankDisplayName
-
hasRank
public boolean hasRank() -
getRankId
-
getRank
Deprecated.Gets the rank displayname -
setRank
Sets the rank id- Parameters:
rank- the rank id
-
getLocale
-
setLocale
-
toPlayer
@Nullable public @Nullable org.bukkit.entity.Player toPlayer() -
mute
-
setMuted
Deprecated. -
setMutedAlly
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)
-
mute(Channel, boolean)