Package dev.scsupercraft.teamstages.data
Class TeamStageSaveHandler
java.lang.Object
dev.scsupercraft.teamstages.data.TeamStageSaveHandler
The class responsible for saving and loading team stages.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.darkhax.gamestages.data.IStageDataGets the player stage data of the current player that has been synced to the client.static net.darkhax.gamestages.data.IStageDataGets the team stage data of the current player that has been synced to the client.static IGameStageDatagetGameDataForPlayer(UUID uuid) Gets the game stage data for the player with the provided UUID.static net.darkhax.gamestages.data.IStageDatagetPlayerData(UUID uuid) Gets the player stage data for the player with the provided UUID.static net.darkhax.gamestages.data.IStageDatagetTeamData(UUID uuid) Gets the stage data for the team with the provided UUID.static net.darkhax.gamestages.data.IStageDatagetTeamDataForPlayer(UUID uuid) Gets the team stage data for the player with the provided UUID.static voidinit()DO NOT USEstatic voidload()Loads all team stage data.static voidLets the save handler know that the data needs loading from the disk.static voidonPlayerLoad(File playerFile, UUID uuid, net.minecraft.network.chat.Component name) Hook for the player LoadFromFile event.static voidsave()Saves all team stage data.static voidsetClientData(Collection<String> player, Collection<String> team) Sets the client's synced stage data.static voidsetGlobalPlayerStageData(Map<UUID, net.darkhax.gamestages.data.IStageData> stageData) DO NOT USE
-
Constructor Details
-
TeamStageSaveHandler
public TeamStageSaveHandler()
-
-
Method Details
-
setGlobalPlayerStageData
@Internal public static void setGlobalPlayerStageData(Map<UUID, net.darkhax.gamestages.data.IStageData> stageData) DO NOT USE- Parameters:
stageData- the new map for storing global player stage data
-
init
DO NOT USE- Throws:
ClassNotFoundException- if game stages is not installed
-
onPlayerLoad
@Internal public static void onPlayerLoad(File playerFile, UUID uuid, net.minecraft.network.chat.Component name) Hook for the player LoadFromFile event. Allows game stage data to be loaded when the player's data is loaded.- Parameters:
playerFile- the file where the player's data is storeduuid- the player's UUIDname- a component holding the player's display name
-
save
@Internal public static void save()Saves all team stage data. -
load
@Internal public static void load()Loads all team stage data. -
markUnloaded
@Internal public static void markUnloaded()Lets the save handler know that the data needs loading from the disk. -
getTeamData
Gets the stage data for the team with the provided UUID.- Parameters:
uuid- the team's UUID- Returns:
- the stage data
-
getTeamDataForPlayer
Gets the team stage data for the player with the provided UUID.- Parameters:
uuid- the player's UUID- Returns:
- the stage data
-
getPlayerData
Gets the player stage data for the player with the provided UUID.- Parameters:
uuid- the player's UUID- Returns:
- the stage data
-
getGameDataForPlayer
Gets the game stage data for the player with the provided UUID.- Parameters:
uuid- the player's UUID- Returns:
- the stage data
-
setClientData
Sets the client's synced stage data.- Parameters:
player- the player stage data for the clientteam- the team stage data for the client
-
getClientPlayerData
public static net.darkhax.gamestages.data.IStageData getClientPlayerData()Gets the player stage data of the current player that has been synced to the client.- Returns:
- the current client side stage data
-
getClientTeamData
public static net.darkhax.gamestages.data.IStageData getClientTeamData()Gets the team stage data of the current player that has been synced to the client.- Returns:
- the current client side stage data
-