Class StorageProxy

java.lang.Object
com.pixelmonmod.pixelmon.api.storage.StorageProxy

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

    • getStorageManager

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

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

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

      public static StorageSaveAdapter 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(StorageSaveAdapter 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<PokemonStorage> 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(PokemonStorage storage)
      Removes the storage from the cache
      Parameters:
      storage - The storage to remove
    • getPCForPlayerNow

      @Nullable public static PCStorage getPCForPlayerNow(net.minecraft.server.level.ServerPlayer player)
      Gets the PC for the given player entity
      Parameters:
      player - The player
      Returns:
      The PC storage
    • getPCForPlayer

      public static CompletableFuture<PCStorage> getPCForPlayer(net.minecraft.server.level.ServerPlayer player)
      Gets the PC for the player waiting until it is loaded from file, if necessary
      Parameters:
      player - The player
      Returns:
      The future PC storage
    • getPCForPlayerNow

      @Nullable public static PCStorage getPCForPlayerNow(UUID uuid)
      Gets the PC for the player with the given UUID
      Parameters:
      uuid - The UUID of the player
      Returns:
      The PC
    • getPCForPlayer

      public static CompletableFuture<PCStorage> getPCForPlayer(UUID uuid)
      Gets the PC for the player waiting until it is loaded from file, if necessary
      Parameters:
      uuid - The UUID of the player
      Returns:
      The future PC storage
    • getPCNow

      @Nullable public static PCStorage getPCNow(net.minecraft.server.level.ServerPlayer player, PCTileEntity pc)
      Gets the player's PC for the given tile entity
      Parameters:
      player - The player
      pc - the PC tile entity
      Returns:
      The PC storage
    • getPC

      public static CompletableFuture<PCStorage> getPC(net.minecraft.server.level.ServerPlayer player, PCTileEntity pc)
      Gets the player's PC for the given tile entity in the future, loading from file if necessary
      Parameters:
      player - The player
      pc - the PC tile entity
      Returns:
      The future PC storage
    • getPartyNow

      @Nullable public static PlayerPartyStorage getPartyNow(net.minecraft.server.level.ServerPlayer player)
      Gets the player's party
      Parameters:
      player - The player
      Returns:
      The party
    • getParty

      public static CompletableFuture<PlayerPartyStorage> getParty(net.minecraft.server.level.ServerPlayer player)
      Gets the player's party waiting until it is loaded from the file if necessary
      Parameters:
      player - The player
      Returns:
      The future party
    • getPartyNow

      @Nullable public static PlayerPartyStorage getPartyNow(UUID uuid)
      Gets the player's party
      Parameters:
      uuid - The player
      Returns:
      The party
    • getParty

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

      public static CompletableFuture<PokemonStorage> getStorage(net.minecraft.server.level.ServerPlayer player, StoragePosition position)
      Gets the storage of a player based on the StoragePosition
      Parameters:
      player - The player
      position - the position
      Returns:
      The future storage
    • getStorageNow

      public static PokemonStorage getStorageNow(net.minecraft.server.level.ServerPlayer player, StoragePosition position)
      Gets the storage of a player based on the StoragePosition
      Parameters:
      player - The player
      position - the position
      Returns:
      The future storage
    • getPokemon

      public static CompletableFuture<Pokemon> getPokemon(net.minecraft.server.level.ServerPlayer player, StoragePosition position)
      Gets a Pokemon using the StoragePosition
      Parameters:
      player - The player
      position - the position
      Returns:
      The future pokemon