Class PokeDexStorageProxy

java.lang.Object
com.pixelmonmod.pixelmon.api.pokedex.PokeDexStorageProxy

public class PokeDexStorageProxy extends Object
Static factory for managing pixelmon pokedex storage
  • Method Details

    • getStorageManager

      public static PokeDexStorageManager getStorageManager()
      Gives you the current storage manager
      Returns:
      - The current storage manager
    • setStorageManager

      public static void setStorageManager(PokeDexStorageManager storageManager)
      Sets the implementation of the storage manager
      Should ideally be set using the PixelmonInitEvent
      Parameters:
      storageManager - - The storage manager implementation
    • getSaveScheduler

      public static PokeDexStorageSaveScheduler getSaveScheduler()
      Gives you the save scheduler of the current storage manager.
      Returns:
      The save scheduler of the current storage manager.
    • setSaveScheduler

      public static void setSaveScheduler(PokeDexStorageSaveScheduler saveScheduler)
      Sets the implementation of the save scheduler
      Should ideally be set using the PixelmonInitEvent
      Parameters:
      saveScheduler - - The save scheduler implementation
    • getSaveAdapter

      public static PokeDexStorageSaveAdapter getSaveAdapter()
      Gives you the save adapter of the current storage manager.
      Returns:
      The save adapter of the current storage manager.
    • setSaveAdapter

      public static void setSaveAdapter(PokeDexStorageSaveAdapter saveAdapter)
      Sets the implementation of the save adapter
      Should ideally be set using the PixelmonInitEvent
      Parameters:
      saveAdapter - The new save adapter
    • getAllCachedStorages

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

      public static void clearAll()
      Clears the cache of all storages
    • invalidateCache

      public static void invalidateCache(PokedexStorage storage)
      Removes the storage from the cache
      Parameters:
      storage - The storage to remove
    • getStorageNow

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

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

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

      public static CompletableFuture<PokedexStorage> getStorage(UUID uuid)
      Gets the player's pokedex storage waiting until it is loaded from the file if necessary
      Parameters:
      uuid - The player
      Returns:
      The future pokedex storage