Class StorageProxy
java.lang.Object
com.pixelmonmod.pixelmon.api.storage.StorageProxy
Static factory for managing pixelmon storage
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclearAll()Clears the cache of all storagesstatic Iterable<PokemonStorage> Gets all the cachedPokemonStoragethis implementation is storingstatic CompletableFuture<PlayerPartyStorage> Gets the player's party waiting until it is loaded from the file if necessarystatic CompletableFuture<PlayerPartyStorage> getParty(net.minecraft.world.entity.player.Player player) Gets the player's party waiting until it is loaded from the file if necessarystatic PlayerPartyStoragegetPartyNow(UUID uuid) Gets the player's partystatic PlayerPartyStoragegetPartyNow(net.minecraft.world.entity.player.Player player) Gets the player's partystatic CompletableFuture<PCStorage> getPC(net.minecraft.world.entity.player.Player player, PCTileEntity pc) Gets the player's PC for the given tile entity in the future, loading from file if necessarystatic CompletableFuture<PCStorage> getPCForPlayer(UUID uuid) Gets the PC for the player waiting until it is loaded from file, if necessarystatic CompletableFuture<PCStorage> getPCForPlayer(net.minecraft.world.entity.player.Player player) Gets the PC for the player waiting until it is loaded from file, if necessarystatic PCStoragegetPCForPlayerNow(UUID uuid) Gets the PC for the player with the given UUIDstatic PCStoragegetPCForPlayerNow(net.minecraft.world.entity.player.Player player) Gets the PC for the given player entitystatic PCStoragegetPCNow(net.minecraft.world.entity.player.Player player, PCTileEntity pc) Gets the player's PC for the given tile entitystatic CompletableFuture<Pokemon> getPokemon(net.minecraft.world.entity.player.Player player, StoragePosition position) Gets a Pokemon using theStoragePositionstatic StorageSaveAdapterGives you the save adapter of the current storage manager.static StorageSaveSchedulerGives you the save scheduler of the current storage manager.static CompletableFuture<PokemonStorage> getStorage(net.minecraft.world.entity.player.Player player, StoragePosition position) Gets the storage of a player based on theStoragePositionstatic StorageManagerGives you the current storage managerstatic PokemonStoragegetStorageNow(net.minecraft.world.entity.player.Player player, StoragePosition position) Gets the storage of a player based on theStoragePositionstatic voidinvalidateCache(PokemonStorage storage) Removes the storage from the cachestatic voidsetSaveAdapter(StorageSaveAdapter saveAdapter) Sets the implementation of the save adapter
Should ideally be set using thePixelmonInitEventstatic voidsetSaveScheduler(StorageSaveScheduler saveScheduler) Sets the implementation of the save scheduler
Should ideally be set using thePixelmonInitEventstatic voidsetStorageManager(StorageManager storageManager) Sets the implementation of the storage manager
Should ideally be set using thePixelmonInitEvent
-
Method Details
-
getStorageManager
Gives you the current storage manager- Returns:
- - The current storage manager
-
setStorageManager
Sets the implementation of the storage manager
Should ideally be set using thePixelmonInitEvent- Parameters:
storageManager- - The storage manager implementation
-
getSaveScheduler
Gives you the save scheduler of the current storage manager.- Returns:
- The save scheduler of the current storage manager.
-
setSaveScheduler
Sets the implementation of the save scheduler
Should ideally be set using thePixelmonInitEvent- Parameters:
saveScheduler- - The save scheduler implementation
-
getSaveAdapter
Gives you the save adapter of the current storage manager.- Returns:
- The save adapter of the current storage manager.
-
setSaveAdapter
Sets the implementation of the save adapter
Should ideally be set using thePixelmonInitEvent- Parameters:
saveAdapter- The new save adapter
-
getAllCachedStorages
Gets all the cachedPokemonStoragethis implementation is storing- Returns:
- The cached storages
-
clearAll
public static void clearAll()Clears the cache of all storages -
invalidateCache
Removes the storage from the cache- Parameters:
storage- The storage to remove
-
getPCForPlayerNow
@Nullable public static PCStorage getPCForPlayerNow(net.minecraft.world.entity.player.Player 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.world.entity.player.Player 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
Gets the PC for the player with the given UUID- Parameters:
uuid- The UUID of the player- Returns:
- The PC
-
getPCForPlayer
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.world.entity.player.Player player, PCTileEntity pc) Gets the player's PC for the given tile entity- Parameters:
player- The playerpc- the PC tile entity- Returns:
- The PC storage
-
getPC
public static CompletableFuture<PCStorage> getPC(net.minecraft.world.entity.player.Player player, PCTileEntity pc) Gets the player's PC for the given tile entity in the future, loading from file if necessary- Parameters:
player- The playerpc- the PC tile entity- Returns:
- The future PC storage
-
getPartyNow
@Nullable public static PlayerPartyStorage getPartyNow(net.minecraft.world.entity.player.Player player) Gets the player's party- Parameters:
player- The player- Returns:
- The party
-
getParty
public static CompletableFuture<PlayerPartyStorage> getParty(net.minecraft.world.entity.player.Player 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
Gets the player's party- Parameters:
uuid- The player- Returns:
- The party
-
getParty
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.world.entity.player.Player player, StoragePosition position) Gets the storage of a player based on theStoragePosition- Parameters:
player- The playerposition- the position- Returns:
- The future storage
-
getStorageNow
public static PokemonStorage getStorageNow(net.minecraft.world.entity.player.Player player, StoragePosition position) Gets the storage of a player based on theStoragePosition- Parameters:
player- The playerposition- the position- Returns:
- The future storage
-
getPokemon
public static CompletableFuture<Pokemon> getPokemon(net.minecraft.world.entity.player.Player player, StoragePosition position) Gets a Pokemon using theStoragePosition- Parameters:
player- The playerposition- the position- Returns:
- The future pokemon
-