类 PlayerEvent.SaveToFile

封闭类:
PlayerEvent

public static class PlayerEvent.SaveToFile extends PlayerEvent
The player is being saved to the world store. Note that the player may be in the process of logging out or otherwise departing from the world. Don't assume it's association with the world. This allows mods to load an additional file from the players directory containing additional mod related player data.
Use this event to save the additional mod related player data to the world.
WARNING: Do not overwrite the player's .dat file here. You will corrupt the world state.
  • 字段详细资料

    • playerDirectory

      private final File playerDirectory
    • playerUUID

      private final String playerUUID
  • 构造器详细资料

    • SaveToFile

      public SaveToFile(Player player, File originDirectory, String playerUUID)
  • 方法详细资料

    • getPlayerFile

      public File getPlayerFile(String suffix)
      Construct and return a recommended file for the supplied suffix
      参数:
      suffix - The suffix to use.
    • getPlayerDirectory

      public File getPlayerDirectory()
      The directory where player data is being stored. Use this to locate your mod additional file.
    • getPlayerUUID

      public String getPlayerUUID()
      The UUID is the standard for player related file storage. It is broken out here for convenience for quick file generation.