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, teamStorageFields inherited from class com.booksaw.betterTeams.team.TeamManager
loadedTeams -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChestClaim(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 teamsvoiddeleteTeamStorage(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 inbooleanisInTeam(org.bukkit.OfflinePlayer player) Used to check if the specified player is in a teambooleanUsed to check if a team exists with that namebooleanUsed to check if a team exists with that uuidvoidUsed to load the stored values into the storage managervoidplayerJoinTeam(Team team, TeamPlayer player) Called when a player joins a team, this can be used to track the players locationvoidplayerLeaveTeam(Team team, TeamPlayer player) Called when a player leaves a teamvoidUsed to reset the balance of all teamsvoidUsed to reset the score of all teamsvoidCan be called by a config option if the server is having difficulties.protected voidregisterNewTeam(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 teamvoidremoveChestclaim(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 lowestvoidteamNameChange(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, setHoloDetailsMethods 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:TeamManagerUsed to check if a team exists with that uuid- Specified by:
isTeamin classTeamManager- Parameters:
uuid- the UUID to check- Returns:
- If a team exists with that uuid
-
isTeam
Description copied from class:TeamManagerUsed to check if a team exists with that name- Specified by:
isTeamin 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:TeamManagerUsed to check if the specified player is in a team- Specified by:
isInTeamin classTeamManager- Parameters:
player- The player to check- Returns:
- If they are in a team
-
getTeamUUID
Description copied from class:TeamManagerUsed to get the uuid of the team that the specified player is in- Specified by:
getTeamUUIDin classTeamManager- Parameters:
player- the plyaer to check for- Returns:
- The team uuid
-
getTeamUUID
Description copied from class:TeamManagerUsed to get the team uuid from the team name- Specified by:
getTeamUUIDin classTeamManager- Parameters:
name- The name of the team- Returns:
- The UUID of the specified team
-
getClaimingTeam
Description copied from class:TeamManagerUsed to get the team which has claimed the provided chest, will return null if that location is not claimed- Overrides:
getClaimingTeamin 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:TeamManagerUsed to get the UUID of the team which has claimed the provided chest, will return null if that location is not claimed- Specified by:
getClaimingTeamUUIDin 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:TeamManagerUsed to load the stored values into the storage manager- Specified by:
loadTeamsin classTeamManager
-
registerNewTeam
Description copied from class:TeamManagerCalled 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:
registerNewTeamin classTeamManager- Parameters:
team- The new teamowner- The player that created the team
-
deleteTeamStorage
Description copied from class:TeamManagerUsed when a team is disbanded, can be used to remove it from any team trackers- Specified by:
deleteTeamStoragein classTeamManager- Parameters:
team- The team that is being disbanded
-
teamNameChange
Description copied from class:TeamManagerCalled when a team changes its name as this will effect the getTeam(String teamName) method- Specified by:
teamNameChangein classTeamManager- Parameters:
team- The new teamnewName- The name the team has changed to
-
playerJoinTeam
Description copied from class:TeamManagerCalled when a player joins a team, this can be used to track the players location- Specified by:
playerJoinTeamin classTeamManager- Parameters:
team- The team that the player has joinedplayer- The player that has joined the team
-
playerLeaveTeam
Description copied from class:TeamManagerCalled when a player leaves a team- Specified by:
playerLeaveTeamin classTeamManager- Parameters:
team- The team that the player has leftplayer- The team that the player has left
-
createTeamStorage
Description copied from class:TeamManagerCalled when a team needs a storage manager to manage all information, this is called for preexisting teams- Specified by:
createTeamStoragein classTeamManager- Parameters:
team- The team instance- Returns:
- The created team storage
-
createNewTeamStorage
Description copied from class:TeamManagerCalled when a new team is made- Specified by:
createNewTeamStoragein classTeamManager- Parameters:
team- The team- Returns:
- The created team storage
-
sortTeamsByScore
Description copied from class:TeamManagerThis method is used to sort all the teams into an array ranking from highest score to lowest- Specified by:
sortTeamsByScorein classTeamManager- Returns:
- the array of teams in order of their rank
-
sortTeamsByBalance
Description copied from class:TeamManagerThis method is used to sort all the team names into an array ranking from highest to lowest- Specified by:
sortTeamsByBalancein classTeamManager- Returns:
- The sorted array
-
sortTeamsByMembers
Description copied from class:TeamManagerUsed to sort all members from largest to smallest by number of members- Specified by:
sortTeamsByMembersin classTeamManager- Returns:
- the sorted array
-
purgeTeamScore
public void purgeTeamScore()Description copied from class:TeamManagerUsed to reset the score of all teams- Specified by:
purgeTeamScorein classTeamManager
-
purgeTeamMoney
public void purgeTeamMoney()Description copied from class:TeamManagerUsed to reset the balance of all teams- Specified by:
purgeTeamMoneyin classTeamManager
-
addChestClaim
- Specified by:
addChestClaimin classTeamManager
-
removeChestclaim
public void removeChestclaim(org.bukkit.Location loc) - Specified by:
removeChestclaimin classTeamManager
-
rebuildLookups
public void rebuildLookups()Description copied from class:TeamManagerCan 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:
rebuildLookupsin classTeamManager
-