Class ResearchStorageProxy

java.lang.Object
com.pixelmonmod.pixelmon.api.storage.research.ResearchStorageProxy

public class ResearchStorageProxy extends Object
Static factory for managing pixelmon research storage
  • Method Details

    • getStorageManager

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

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

      public static ResearchStorageSaveScheduler 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(ResearchStorageSaveScheduler saveScheduler)
      Sets the implementation of the save scheduler
      Should ideally be set using the PixelmonInitEvent
      Parameters:
      saveScheduler - - The save scheduler implementation
    • getSaveAdapter

      public static ResearchStorageSaveAdapter 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(ResearchStorageSaveAdapter 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<ResearchStorage> getAllCachedStorages()
      Gets all the cached PokemonStorage this implementation is storing
      Returns:
      The cached storages
    • clearAll

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

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

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

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

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

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