Class Storage
java.lang.Object
org.strassburger.lifestealz.util.storage.Storage
- Direct Known Subclasses:
SQLStorage
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract String
Export the player data to a file.Get a list of all eliminated players.Get all player namesprotected LifeStealZ
abstract void
importData
(String fileName) Import the player data from a file.abstract void
init()
Initializes the storage system.abstract PlayerData
Loads the player data from the storage system.abstract PlayerData
Loads the player data from the storage system.abstract int
reviveAllPlayers
(int minHearts, int reviveHearts, int maxRevives, boolean bypassReviveLimit) Set the amount of hearts for every eliminated player to the given amount.abstract void
save
(PlayerData playerData) Saves the player data to the storage system.
-
Constructor Details
-
Storage
-
-
Method Details
-
getPlugin
-
init
public abstract void init()Initializes the storage system. -
save
Saves the player data to the storage system.- Parameters:
playerData
- The player data to save.
-
load
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
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
Get a list of all eliminated players. -
export
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
Import the player data from a file.- Parameters:
fileName
- The name of the file to import from.
-
getPlayerNames
Get all player names -
getEliminatedPlayerNames
-