java.lang.Object
org.strassburger.lifestealz.util.storage.Storage
Direct Known Subclasses:
SQLStorage

public abstract class Storage extends Object
  • Constructor Details

  • Method Details

    • getPlugin

      protected LifeStealZ getPlugin()
    • init

      public abstract void init()
      Initializes the storage system.
    • save

      public abstract void save(PlayerData playerData)
      Saves the player data to the storage system.
      Parameters:
      playerData - The player data to save.
    • load

      public abstract PlayerData load(String uuid)
      Loads the player data from the storage system.
      Parameters:
      uuid - The UUID of the player to load.
      Returns:
      The player data of the player.
    • load

      public abstract PlayerData load(UUID uuid)
      Loads the player data from the storage system.
      Parameters:
      uuid - The UUID of the player to load.
      Returns:
      The player data of the player.
    • getEliminatedPlayers

      public abstract List<UUID> getEliminatedPlayers()
      Get a list of all eliminated players.
    • export

      public abstract String export(String fileName)
      Export the player data to a file.
      Parameters:
      fileName - The name of the file to export to.
      Returns:
      The path to the exported file.
    • reviveAllPlayers

      public abstract int reviveAllPlayers(int minHearts, int reviveHearts, int maxRevives, boolean bypassReviveLimit)
      Set the amount of hearts for every eliminated player to the given amount.
      Parameters:
      minHearts - The amount of hearts a player has to be considered eliminated.
      reviveHearts - The amount of hearts to set for every eliminated player.
      maxRevives - The maximum amount of revives a player can have.
      bypassReviveLimit - Whether the revive limit should be bypassed.
      Returns:
      The amount of players that were affected.
    • importData

      public abstract void importData(String fileName)
      Import the player data from a file.
      Parameters:
      fileName - The name of the file to import from.
    • getPlayerNames

      public abstract List<String> getPlayerNames()
      Get all player names
    • getEliminatedPlayerNames

      public abstract List<String> getEliminatedPlayerNames()