Class TeamStageSaveHandler

java.lang.Object
dev.scsupercraft.teamstages.data.TeamStageSaveHandler

public class TeamStageSaveHandler extends Object
The class responsible for saving and loading team stages.
  • 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

      @Internal public static void init() throws ClassNotFoundException
      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 stored
      uuid - the player's UUID
      name - 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

      @Nullable public static net.darkhax.gamestages.data.IStageData getTeamData(UUID uuid)
      Gets the stage data for the team with the provided UUID.
      Parameters:
      uuid - the team's UUID
      Returns:
      the stage data
    • getTeamDataForPlayer

      @Nullable public static net.darkhax.gamestages.data.IStageData getTeamDataForPlayer(UUID uuid)
      Gets the team stage data for the player with the provided UUID.
      Parameters:
      uuid - the player's UUID
      Returns:
      the stage data
    • getPlayerData

      @Nullable public static net.darkhax.gamestages.data.IStageData getPlayerData(UUID uuid)
      Gets the player stage data for the player with the provided UUID.
      Parameters:
      uuid - the player's UUID
      Returns:
      the stage data
    • getGameDataForPlayer

      public static IGameStageData getGameDataForPlayer(UUID uuid)
      Gets the game stage data for the player with the provided UUID.
      Parameters:
      uuid - the player's UUID
      Returns:
      the stage data
    • setClientData

      public static void setClientData(Collection<String> player, Collection<String> team)
      Sets the client's synced stage data.
      Parameters:
      player - the player stage data for the client
      team - 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