Class ClanManager
java.lang.Object
net.sacredlabyrinth.phaed.simpleclans.managers.ClanManager
- Author:
- phaed
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a kill to the memoryvoidvoidBans a player from clan commandsvoidDeletes all clans and clan players in memoryvoidcreateClan(org.bukkit.entity.Player player, String colorTag, String name) Create a new clanvoidDelete a players data filevoiddeleteClanPlayerFromMemory(UUID playerUniqueId) Delete a player data from memoryReturns the collection of all clan players, including the disabled ones@Nullable ClanPlayergetAnyClanPlayer(String playerName) @Nullable ClanPlayergetAnyClanPlayer(UUID uuid) Gets the ClanPlayer data object for the player, will retrieve disabled clan players as well, these are players who used to be in a clan but are not currently in one, their data file persists and can be accessed. their clan will be null though.getArmorString(org.bukkit.inventory.PlayerInventory inv) Returns a formatted string detailing the players armorgetBar(double length) Returns a colored bar based on the lengthReturns the clan the tag belongs to@Nullable ClangetClanByPlayerName(String playerName) @Nullable ClangetClanByPlayerUniqueId(UUID playerUniqueId) Get a player's clan@Nullable ClanPlayergetClanPlayer(String playerName) @Nullable ClanPlayergetClanPlayer(UUID playerUniqueId) Gets the ClanPlayer data object if a player is currently in a clan, null if he's not in a clan@Nullable ClanPlayergetClanPlayer(@NotNull org.bukkit.OfflinePlayer player) Gets the ClanPlayer data object if a player is currently in a clan, null if he's not in a clan@Nullable ClanPlayergetClanPlayer(@NotNull org.bukkit.entity.Player player) Gets the ClanPlayer data object if a player is currently in a clan, null if he's not in a clan@Nullable ClanPlayergetClanPlayerJoinEvent(org.bukkit.entity.Player player) Deprecated.@Nullable ClanPlayergetClanPlayerName(String playerName) Deprecated.getClans()@NotNull ClanPlayergetCreateClanPlayer(String playerName) getCreateClanPlayer(UUID uuid) Gets the ClanPlayer object for the player, creates one if not found@Nullable ClanPlayergetCreateClanPlayerUUID(String playerName) Deprecated.getFoodString(org.bukkit.inventory.PlayerInventory inv) Returns a formatted string detailing the players foodlonggetMinutesBeforeRejoin(@NotNull ClanPlayer cp, @NotNull Clan clan) intGet a count of rivable clansgetWeaponString(org.bukkit.inventory.PlayerInventory inv) Returns a formatted string detailing the players weaponsvoidimportClan(Clan clan) Import a clan into the in-memory storevoidImport a clan player into the in-memory storebooleanWhether the tag belongs to a clanbooleanisKillBeforeDelay(Kill kill) Checks if this kill respects the delaybooleanprocessGlobalChat(org.bukkit.entity.Player player, String msg) Deprecated.booleanpurchaseCreation(org.bukkit.entity.Player player) Purchase clan creationbooleanpurchaseHomeRegroup(org.bukkit.entity.Player player) Purchase Home RegroupbooleanpurchaseHomeTeleport(org.bukkit.entity.Player player) Purchase Home TeleportbooleanpurchaseHomeTeleportSet(org.bukkit.entity.Player player) Purchase Home Teleport SetbooleanpurchaseInvite(org.bukkit.entity.Player player) Purchase invitebooleanpurchaseMemberFeeSet(org.bukkit.entity.Player player) Purchase member fee setbooleanpurchaseResetKdr(org.bukkit.entity.Player player) Purchase Reset KdrbooleanpurchaseVerification(org.bukkit.entity.Player player) Purchase clan verificationvoidremoveClan(String tag) Remove a clan from memoryvoidresetKdr(ClanPlayer cp) Reset a player's KDRvoidserverAnnounce(String msg) Announce message to the servervoidSort clan players by KDRvoidSort clan players by last seen daysvoidsortClansByActive(List<Clan> clans, boolean asc) Sort clans by activevoidsortClansByFounded(List<Clan> clans, boolean asc) Sort clans by founded datevoidsortClansByKDR(List<Clan> clans) Sort clans by KDRvoidsortClansByKDR(List<Clan> clans, boolean asc) Sort clans by kdrvoidsortClansByName(List<Clan> clans, boolean asc) Sort clans by namevoidsortClansBySize(List<Clan> clans) Sort clans by KDRvoidsortClansBySize(List<Clan> clans, boolean asc) Sort clans by sizevoidupdateDisplayName(@Nullable org.bukkit.entity.Player player) Update the players display name with his clan's tagvoidupdateLastSeen(org.bukkit.entity.Player player) Process a player and his clan's last seen date
-
Constructor Details
-
ClanManager
public ClanManager()
-
-
Method Details
-
cleanData
public void cleanData()Deletes all clans and clan players in memory -
addKill
Adds a kill to the memory -
isKillBeforeDelay
Checks if this kill respects the delay -
importClan
Import a clan into the in-memory store -
importClanPlayer
Import a clan player into the in-memory store -
createClan
Create a new clan -
resetKdr
Reset a player's KDR -
deleteClanPlayer
Delete a players data file -
deleteClanPlayerFromMemory
Delete a player data from memory -
removeClan
Remove a clan from memory -
isClan
Whether the tag belongs to a clan -
getClan
Returns the clan the tag belongs to -
getClanByPlayerName
-
getClanByPlayerUniqueId
Get a player's clan- Returns:
- null if not in a clan
-
getClans
- Returns:
- the clans
-
getAllClanPlayers
Returns the collection of all clan players, including the disabled ones -
getClanPlayerJoinEvent
@Deprecated @Nullable public @Nullable ClanPlayer getClanPlayerJoinEvent(org.bukkit.entity.Player player) Deprecated.Gets the ClanPlayer data object if a player is currently in a clan, null if he's not in a clan Used for BungeeCord Reload ClanPlayer and your Clan -
getClanPlayer
@Nullable public @Nullable ClanPlayer getClanPlayer(@NotNull @NotNull org.bukkit.OfflinePlayer player) Gets the ClanPlayer data object if a player is currently in a clan, null if he's not in a clan -
getClanPlayer
@Nullable public @Nullable ClanPlayer getClanPlayer(@NotNull @NotNull org.bukkit.entity.Player player) Gets the ClanPlayer data object if a player is currently in a clan, null if he's not in a clan -
getClanPlayer
Gets the ClanPlayer data object if a player is currently in a clan, null if he's not in a clan -
getClanPlayer
-
getClanPlayerName
Deprecated.Gets the ClanPlayer data object if a player is currently in a clan, null if he's not in a clan -
getAnyClanPlayer
Gets the ClanPlayer data object for the player, will retrieve disabled clan players as well, these are players who used to be in a clan but are not currently in one, their data file persists and can be accessed. their clan will be null though. -
getAnyClanPlayer
-
getCreateClanPlayerUUID
Deprecated.Gets the ClanPlayer object for the player, creates one if not found -
getCreateClanPlayer
Gets the ClanPlayer object for the player, creates one if not found -
getCreateClanPlayer
-
serverAnnounce
Announce message to the server- Parameters:
msg- the message
-
updateDisplayName
public void updateDisplayName(@Nullable @Nullable org.bukkit.entity.Player player) Update the players display name with his clan's tag -
updateLastSeen
public void updateLastSeen(org.bukkit.entity.Player player) Process a player and his clan's last seen date -
ban
-
ban
Bans a player from clan commands- Parameters:
uuid- the player's uuid
-
getRivableClanCount
public int getRivableClanCount()Get a count of rivable clans -
getArmorString
Returns a formatted string detailing the players armor -
getWeaponString
Returns a formatted string detailing the players weapons -
getFoodString
Returns a formatted string detailing the players food- Parameters:
inv- the PlayerInventory- Returns:
- the food points string
-
getBar
Returns a colored bar based on the length -
sortClansByActive
Sort clans by active -
sortClansByFounded
Sort clans by founded date -
sortClansByKDR
Sort clans by kdr -
sortClansBySize
Sort clans by size -
sortClansByName
Sort clans by name -
sortClansByKDR
Sort clans by KDR -
sortClansBySize
Sort clans by KDR -
sortClanPlayersByKDR
Sort clan players by KDR -
sortClanPlayersByLastSeen
Sort clan players by last seen days -
getMinutesBeforeRejoin
-
purchaseMemberFeeSet
public boolean purchaseMemberFeeSet(org.bukkit.entity.Player player) Purchase member fee set -
purchaseCreation
public boolean purchaseCreation(org.bukkit.entity.Player player) Purchase clan creation -
purchaseInvite
public boolean purchaseInvite(org.bukkit.entity.Player player) Purchase invite -
purchaseHomeTeleport
public boolean purchaseHomeTeleport(org.bukkit.entity.Player player) Purchase Home Teleport -
purchaseHomeTeleportSet
public boolean purchaseHomeTeleportSet(org.bukkit.entity.Player player) Purchase Home Teleport Set -
purchaseResetKdr
public boolean purchaseResetKdr(org.bukkit.entity.Player player) Purchase Reset Kdr -
purchaseHomeRegroup
public boolean purchaseHomeRegroup(org.bukkit.entity.Player player) Purchase Home Regroup -
purchaseVerification
public boolean purchaseVerification(org.bukkit.entity.Player player) Purchase clan verification -
processGlobalChat
Deprecated.Processes a global chat command
-