Class ClientSessionData

All Implemented Interfaces:
IAttachmentHolder

@Internal public final class ClientSessionData extends SessionData

Session data for the client.

Persistent attachments that aren't synced are saved by the client using a per-(world/server/lan-world) path. Synced attachments are server authoritative and are never saved on the client.

  • Field Details

  • Constructor Details

  • Method Details

    • create

      public static ClientSessionData create(Minecraft minecraft, ClientPacketListener listener)
    • resolveFile

      public static Path resolveFile(Path gameDirectory, @Nullable IntegratedServer singleplayerServer, @Nullable ServerData serverData)
      World file for the singleplayer host, game directory file keyed by server otherwise.
      Throws:
      IllegalStateException - If neither the integrated server nor the server data are provided.
    • storageKey

      public static String storageKey(ServerData serverData)
      Realms and LAN games have no stable address, so they are keyed by name instead. Keys do not survive renames or host IP changes, and a server transfer keeps the origin server's key. Keys longer than 64 characters are clamped and suffixed with a hash of the original key.
    • load

      public void load()
    • save

      public void save()
    • tick

      public void tick()
    • problemPath

      private ProblemReporter.PathElement problemPath()