Class SQLStorage

java.lang.Object
org.strassburger.lifestealz.util.storage.Storage
org.strassburger.lifestealz.util.storage.SQLStorage
Direct Known Subclasses:
MariaDBStorage, MySQLStorage, SQLiteStorage

public abstract class SQLStorage extends Storage
  • Constructor Details

    • SQLStorage

      public SQLStorage(LifeStealZ plugin)
  • Method Details

    • init

      public void init()
      Description copied from class: Storage
      Initializes the storage system.
      Specified by:
      init in class Storage
    • load

      public PlayerData load(UUID uuid)
      Description copied from class: Storage
      Loads the player data from the storage system.
      Specified by:
      load in class Storage
      Parameters:
      uuid - The UUID of the player to load.
      Returns:
      The player data of the player.
    • load

      public PlayerData load(String uuid)
      Description copied from class: Storage
      Loads the player data from the storage system.
      Specified by:
      load in class Storage
      Parameters:
      uuid - The UUID of the player to load.
      Returns:
      The player data of the player.
    • getEliminatedPlayers

      public List<UUID> getEliminatedPlayers()
      Description copied from class: Storage
      Get a list of all eliminated players.
      Specified by:
      getEliminatedPlayers in class Storage
    • export

      public String export(String fileName)
      Description copied from class: Storage
      Export the player data to a file.
      Specified by:
      export in class Storage
      Parameters:
      fileName - The name of the file to export to.
      Returns:
      The path to the exported file.
    • importData

      public void importData(String fileName)
      Description copied from class: Storage
      Import the player data from a file.
      Specified by:
      importData in class Storage
      Parameters:
      fileName - The name of the file to import from.
    • reviveAllPlayers

      public int reviveAllPlayers(int minHearts, int reviveHearts, int maxRevives, boolean bypassReviveLimit)
      Description copied from class: Storage
      Set the amount of hearts for every eliminated player to the given amount.
      Specified by:
      reviveAllPlayers in class Storage
      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.
    • getPlayerNames

      public List<String> getPlayerNames()
      Description copied from class: Storage
      Get all player names
      Specified by:
      getPlayerNames in class Storage
    • getEliminatedPlayerNames

      public List<String> getEliminatedPlayerNames()
      Specified by:
      getEliminatedPlayerNames in class Storage