Class FlatfileStorageManager
java.lang.Object
com.booksaw.betterTeams.team.TeamManager
com.booksaw.betterTeams.team.storage.storageManager.YamlStorageManager
com.booksaw.betterTeams.team.storage.storageManager.FlatfileStorageManager
-
Field Summary
Fields inherited from class com.booksaw.betterTeams.team.storage.storageManager.YamlStorageManager
TEAMLISTSTORAGELOC, teamStorage
Fields inherited from class com.booksaw.betterTeams.team.TeamManager
loadedTeams
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChestClaim
(Team team, org.bukkit.Location loc) createNewTeamStorage
(Team team) Called when a new team is madecreateTeamStorage
(Team team) Called when a team needs a storage manager to manage all information, this is called for preexisting teamsvoid
deleteTeamStorage
(Team team) Used when a team is disbanded, can be used to remove it from any team trackersgetClaimingTeam
(org.bukkit.Location location) Used to get the team which has claimed the provided chest, will return null if that location is not claimedgetClaimingTeamUUID
(org.bukkit.Location location) Used to get the UUID of the team which has claimed the provided chest, will return null if that location is not claimedgetTeamUUID
(@Nullable String name) Used to get the team uuid from the team namegetTeamUUID
(org.bukkit.OfflinePlayer player) Used to get the uuid of the team that the specified player is inboolean
isInTeam
(org.bukkit.OfflinePlayer player) Used to check if the specified player is in a teamboolean
Used to check if a team exists with that nameboolean
Used to check if a team exists with that uuidvoid
Used to load the stored values into the storage managervoid
playerJoinTeam
(Team team, TeamPlayer player) Called when a player joins a team, this can be used to track the players locationvoid
playerLeaveTeam
(Team team, TeamPlayer player) Called when a player leaves a teamvoid
Used to reset the balance of all teamsvoid
Used to reset the score of all teamsvoid
Can be called by a config option if the server is having difficulties.protected void
registerNewTeam
(Team team, org.bukkit.entity.Player owner) Called when a new team is registered, this can be used to register it in any full team trackers The team file will be fully prepared with the members within the teamvoid
removeChestclaim
(org.bukkit.Location loc) String[]
This method is used to sort all the team names into an array ranking from highest to lowestString[]
Used to sort all members from largest to smallest by number of membersString[]
This method is used to sort all the teams into an array ranking from highest score to lowestvoid
teamNameChange
(Team team, String newName) Called when a team changes its name as this will effect the getTeam(String teamName) methodMethods inherited from class com.booksaw.betterTeams.team.storage.storageManager.YamlStorageManager
getHoloDetails, getTeamStorage, saveTeamsFile, setHoloDetails
Methods inherited from class com.booksaw.betterTeams.team.TeamManager
createNewTeam, disable, disbandTeam, getClaimingLocation, getClaimingTeam, getLoadedTeamListClone, getTeam, getTeam, getTeam, getTeamByName, isLoaded, isLogChat, purgeTeams
-
Constructor Details
-
FlatfileStorageManager
public FlatfileStorageManager()
-
-
Method Details
-
isTeam
Description copied from class:TeamManager
Used to check if a team exists with that uuid- Specified by:
isTeam
in classTeamManager
- Parameters:
uuid
- the UUID to check- Returns:
- If a team exists with that uuid
-
isTeam
Description copied from class:TeamManager
Used to check if a team exists with that name- Specified by:
isTeam
in classTeamManager
- Parameters:
name
- the name to check- Returns:
- If a team exists with that name
-
isInTeam
public boolean isInTeam(org.bukkit.OfflinePlayer player) Description copied from class:TeamManager
Used to check if the specified player is in a team- Specified by:
isInTeam
in classTeamManager
- Parameters:
player
- The player to check- Returns:
- If they are in a team
-
getTeamUUID
Description copied from class:TeamManager
Used to get the uuid of the team that the specified player is in- Specified by:
getTeamUUID
in classTeamManager
- Parameters:
player
- the plyaer to check for- Returns:
- The team uuid
-
getTeamUUID
Description copied from class:TeamManager
Used to get the team uuid from the team name- Specified by:
getTeamUUID
in classTeamManager
- Parameters:
name
- The name of the team- Returns:
- The UUID of the specified team
-
getClaimingTeam
Description copied from class:TeamManager
Used to get the team which has claimed the provided chest, will return null if that location is not claimed- Overrides:
getClaimingTeam
in classTeamManager
- Parameters:
location
- the location of the chest - must already be normalised- Returns:
- The team which has claimed that chest
-
getClaimingTeamUUID
Description copied from class:TeamManager
Used to get the UUID of the team which has claimed the provided chest, will return null if that location is not claimed- Specified by:
getClaimingTeamUUID
in classTeamManager
- Parameters:
location
- The location of the chest - must already be normalised- Returns:
- the team which has claimed that chest
-
loadTeams
public void loadTeams()Description copied from class:TeamManager
Used to load the stored values into the storage manager- Specified by:
loadTeams
in classTeamManager
-
registerNewTeam
Description copied from class:TeamManager
Called when a new team is registered, this can be used to register it in any full team trackers The team file will be fully prepared with the members within the team- Specified by:
registerNewTeam
in classTeamManager
- Parameters:
team
- The new teamowner
- The player that created the team
-
deleteTeamStorage
Description copied from class:TeamManager
Used when a team is disbanded, can be used to remove it from any team trackers- Specified by:
deleteTeamStorage
in classTeamManager
- Parameters:
team
- The team that is being disbanded
-
teamNameChange
Description copied from class:TeamManager
Called when a team changes its name as this will effect the getTeam(String teamName) method- Specified by:
teamNameChange
in classTeamManager
- Parameters:
team
- The new teamnewName
- The name the team has changed to
-
playerJoinTeam
Description copied from class:TeamManager
Called when a player joins a team, this can be used to track the players location- Specified by:
playerJoinTeam
in classTeamManager
- Parameters:
team
- The team that the player has joinedplayer
- The player that has joined the team
-
playerLeaveTeam
Description copied from class:TeamManager
Called when a player leaves a team- Specified by:
playerLeaveTeam
in classTeamManager
- Parameters:
team
- The team that the player has leftplayer
- The team that the player has left
-
createTeamStorage
Description copied from class:TeamManager
Called when a team needs a storage manager to manage all information, this is called for preexisting teams- Specified by:
createTeamStorage
in classTeamManager
- Parameters:
team
- The team instance- Returns:
- The created team storage
-
createNewTeamStorage
Description copied from class:TeamManager
Called when a new team is made- Specified by:
createNewTeamStorage
in classTeamManager
- Parameters:
team
- The team- Returns:
- The created team storage
-
sortTeamsByScore
Description copied from class:TeamManager
This method is used to sort all the teams into an array ranking from highest score to lowest- Specified by:
sortTeamsByScore
in classTeamManager
- Returns:
- the array of teams in order of their rank
-
sortTeamsByBalance
Description copied from class:TeamManager
This method is used to sort all the team names into an array ranking from highest to lowest- Specified by:
sortTeamsByBalance
in classTeamManager
- Returns:
- The sorted array
-
sortTeamsByMembers
Description copied from class:TeamManager
Used to sort all members from largest to smallest by number of members- Specified by:
sortTeamsByMembers
in classTeamManager
- Returns:
- the sorted array
-
purgeTeamScore
public void purgeTeamScore()Description copied from class:TeamManager
Used to reset the score of all teams- Specified by:
purgeTeamScore
in classTeamManager
-
purgeTeamMoney
public void purgeTeamMoney()Description copied from class:TeamManager
Used to reset the balance of all teams- Specified by:
purgeTeamMoney
in classTeamManager
-
addChestClaim
- Specified by:
addChestClaim
in classTeamManager
-
removeChestclaim
public void removeChestclaim(org.bukkit.Location loc) - Specified by:
removeChestclaim
in classTeamManager
-
rebuildLookups
public void rebuildLookups()Description copied from class:TeamManager
Can be called by a config option if the server is having difficulties. Do not call from anywhere else as it may cause problems depending on the storage type- Specified by:
rebuildLookups
in classTeamManager
-