Class SQLStorageManager
java.lang.Object
com.booksaw.betterTeams.team.TeamManager
com.booksaw.betterTeams.team.storage.storageManager.SQLStorageManager
- All Implemented Interfaces:
org.bukkit.event.Listener
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected final org.bukkit.configuration.file.FileConfigurationFields 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 teamsprotected voiddeleteTeamStorage(Team team) Used when a team is disbanded, can be used to remove it from any team trackersvoiddisable()this can be overritten if any code needs to be run when onDisable is calledgetClaimingTeamUUID(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(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 uuidvoidvoidUsed to load the stored values into the storage managervoidonJoin(org.bukkit.event.player.PlayerJoinEvent e) voidonLeave(org.bukkit.event.player.PlayerQuitEvent e) voidplayerJoinTeam(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 player) 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) voidvoidsetHoloDetails(List<String> details) Used to store and save the updated hologram detailsString[]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) methodvoidunloadTeam(UUID uuid) Methods inherited from class com.booksaw.betterTeams.team.TeamManager
createNewTeam, disbandTeam, getClaimingLocation, getClaimingTeam, getClaimingTeam, getLoadedTeamListClone, getTeam, getTeam, getTeam, getTeamByName, isLoaded, isLogChat, purgeTeams
-
Field Details
-
teamStorage
protected final org.bukkit.configuration.file.FileConfiguration teamStorage -
TEAMLISTSTORAGELOC
- See Also:
-
-
Constructor Details
-
SQLStorageManager
public SQLStorageManager()
-
-
Method Details
-
disable
public void disable()Description copied from class:TeamManagerthis can be overritten if any code needs to be run when onDisable is called- Overrides:
disablein classTeamManager
-
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
-
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
-
loadTeams
public void loadTeams()Description copied from class:TeamManagerUsed to load the stored values into the storage manager- Specified by:
loadTeamsin classTeamManager
-
loadTeam
-
unloadTeam
-
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 teamplayer- 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
-
getHoloDetails
- Specified by:
getHoloDetailsin classTeamManager- Returns:
- The stored hologram details
-
setHoloDetails
Description copied from class:TeamManagerUsed to store and save the updated hologram details- Specified by:
setHoloDetailsin classTeamManager- Parameters:
details- the details to save
-
saveTeamsFile
public void saveTeamsFile() -
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
-
onJoin
public void onJoin(org.bukkit.event.player.PlayerJoinEvent e) -
onLeave
public void onLeave(org.bukkit.event.player.PlayerQuitEvent e) -
getDatabase
-