Klasse StashStore

java.lang.Object
de.delinkedde.mobarenareborn.player.StashStore

public final class StashStore extends Object
Persists PlayerStash snapshots to disk while their owner is inside an arena.

A stash is written when the player joins an arena and deleted as soon as it is restored through any normal path (leave, elimination cleanup, round end, quit). If the server crashes mid-round, the stash therefore survives in stashes.yml; on the player's next join the pending snapshot is applied so they get their real inventory, hearts and location back instead of keeping the arena kit.

  • Konstruktordetails

    • StashStore

      public StashStore(@NotNull @NotNull MobArenaPlugin plugin)
      Parameter:
      plugin - the owning plugin, used for the data folder and logging
  • Methodendetails

    • save

      public void save(@NotNull @NotNull UUID uuid, @NotNull @NotNull PlayerStash stash)
      Persists a stash for a player.
      Parameter:
      uuid - the player's unique id
      stash - the stash to persist
    • has

      public boolean has(@NotNull @NotNull UUID uuid)
      Parameter:
      uuid - the player's unique id
      Gibt zurück:
      whether a persisted stash exists for the player
    • load

      @Nullable public @Nullable PlayerStash load(@NotNull @NotNull UUID uuid)
      Loads a player's persisted stash.
      Parameter:
      uuid - the player's unique id
      Gibt zurück:
      the stash, or null if none is stored or it cannot be read
    • delete

      public void delete(@NotNull @NotNull UUID uuid)
      Deletes a player's persisted stash after a successful restore.
      Parameter:
      uuid - the player's unique id