Interface PokeDexStorageManager

All Known Implementing Classes:
SimplePokeDexStorageManager

public interface PokeDexStorageManager
The storage manager is the class that needs to be implemented for handling the load and saving of the player's pokedex data
It's recommended that you use the methods that return CompletableFuture as these will not lock the main thread if the player's storage is still loading when you attempt to access it.
However, there are equivalent methods that return the pokdex storage directly (usually suffixed with Now) and they will hold your current thread until the player's storage has finished loading from when they logged in (or whenever the access was first called) by default. This could vary with implementation so is worth checking
  • Method Details

    • getAllCachedStorages

      Iterable<PokedexStorage> getAllCachedStorages()
      Gets all the cached PokedexStorage this implementation is storing
      Returns:
      The cached storages
    • clearAll

      void clearAll()
      Clears the cache of all storages
    • getStorageNow

      @Nullable default PokedexStorage getStorageNow(net.minecraft.server.level.ServerPlayer player)
      Gets the player's pokdex storage
      Parameters:
      player - The player
      Returns:
      The pokdex storage
    • getStorage

      default CompletableFuture<PokedexStorage> getStorage(net.minecraft.server.level.ServerPlayer player)
      Gets the player's pokdex storage waiting until it is loaded from the file if necessary
      Parameters:
      player - The player
      Returns:
      The future pokdex storage
    • getStorageNow

      @Nullable default PokedexStorage getStorageNow(UUID uuid)
      Gets the player's pokdex storage
      Parameters:
      uuid - The player
      Returns:
      The pokdex storage
    • getStorage

      Gets the player's pokdex storage waiting until it is loaded from the file if necessary
      Parameters:
      uuid - The player
      Returns:
      The future pokdex storage
    • invalidateCache

      void invalidateCache(PokedexStorage storage)
      Removes the cache of the given storage
      Parameters:
      storage - The storage to remove