Class FlatfileStorageManager


public class FlatfileStorageManager extends YamlStorageManager
  • Constructor Details

    • FlatfileStorageManager

      public FlatfileStorageManager()
  • Method Details

    • isTeam

      @Contract(pure=true, value="null -> false") public boolean isTeam(@Nullable @Nullable UUID uuid)
      Description copied from class: TeamManager
      Used to check if a team exists with that uuid
      Specified by:
      isTeam in class TeamManager
      Parameters:
      uuid - the UUID to check
      Returns:
      If a team exists with that uuid
    • isTeam

      @Contract(pure=true, value="null -> false") public boolean isTeam(@Nullable @Nullable String name)
      Description copied from class: TeamManager
      Used to check if a team exists with that name
      Specified by:
      isTeam in class TeamManager
      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 class TeamManager
      Parameters:
      player - The player to check
      Returns:
      If they are in a team
    • getTeamUUID

      public UUID getTeamUUID(org.bukkit.OfflinePlayer player)
      Description copied from class: TeamManager
      Used to get the uuid of the team that the specified player is in
      Specified by:
      getTeamUUID in class TeamManager
      Parameters:
      player - the plyaer to check for
      Returns:
      The team uuid
    • getTeamUUID

      public UUID getTeamUUID(@Nullable @Nullable String name)
      Description copied from class: TeamManager
      Used to get the team uuid from the team name
      Specified by:
      getTeamUUID in class TeamManager
      Parameters:
      name - The name of the team
      Returns:
      The UUID of the specified team
    • getClaimingTeam

      public Team getClaimingTeam(org.bukkit.Location location)
      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 class TeamManager
      Parameters:
      location - the location of the chest - must already be normalised
      Returns:
      The team which has claimed that chest
    • getClaimingTeamUUID

      public UUID getClaimingTeamUUID(org.bukkit.Location location)
      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 class TeamManager
      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 class TeamManager
    • registerNewTeam

      protected void registerNewTeam(Team team, org.bukkit.entity.Player owner)
      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 class TeamManager
      Parameters:
      team - The new team
      owner - The player that created the team
    • deleteTeamStorage

      public void deleteTeamStorage(Team team)
      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 class TeamManager
      Parameters:
      team - The team that is being disbanded
    • teamNameChange

      public void teamNameChange(Team team, String newName)
      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 class TeamManager
      Parameters:
      team - The new team
      newName - The name the team has changed to
    • playerJoinTeam

      public void playerJoinTeam(Team team, TeamPlayer player)
      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 class TeamManager
      Parameters:
      team - The team that the player has joined
      player - The player that has joined the team
    • playerLeaveTeam

      public void playerLeaveTeam(Team team, TeamPlayer player)
      Description copied from class: TeamManager
      Called when a player leaves a team
      Specified by:
      playerLeaveTeam in class TeamManager
      Parameters:
      team - The team that the player has left
      player - The team that the player has left
    • createTeamStorage

      public TeamStorage createTeamStorage(Team team)
      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 class TeamManager
      Parameters:
      team - The team instance
      Returns:
      The created team storage
    • createNewTeamStorage

      public TeamStorage createNewTeamStorage(Team team)
      Description copied from class: TeamManager
      Called when a new team is made
      Specified by:
      createNewTeamStorage in class TeamManager
      Parameters:
      team - The team
      Returns:
      The created team storage
    • sortTeamsByScore

      public String[] 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 class TeamManager
      Returns:
      the array of teams in order of their rank
    • sortTeamsByBalance

      public String[] 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 class TeamManager
      Returns:
      The sorted array
    • sortTeamsByMembers

      public String[] sortTeamsByMembers()
      Description copied from class: TeamManager
      Used to sort all members from largest to smallest by number of members
      Specified by:
      sortTeamsByMembers in class TeamManager
      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 class TeamManager
    • purgeTeamMoney

      public void purgeTeamMoney()
      Description copied from class: TeamManager
      Used to reset the balance of all teams
      Specified by:
      purgeTeamMoney in class TeamManager
    • addChestClaim

      public void addChestClaim(Team team, org.bukkit.Location loc)
      Specified by:
      addChestClaim in class TeamManager
    • removeChestclaim

      public void removeChestclaim(org.bukkit.Location loc)
      Specified by:
      removeChestclaim in class TeamManager
    • 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 class TeamManager