Class PokeDexStorageProxy
java.lang.Object
com.pixelmonmod.pixelmon.api.pokedex.PokeDexStorageProxy
Static factory for managing pixelmon pokedex storage
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclearAll()Clears the cache of all storagesstatic Iterable<PokedexStorage> Gets all the cachedPokedexStoragethis implementation is storingstatic PokeDexStorageSaveAdapterGives you the save adapter of the current storage manager.static PokeDexStorageSaveSchedulerGives you the save scheduler of the current storage manager.static CompletableFuture<PokedexStorage> getStorage(UUID uuid) Gets the player's pokedex storage waiting until it is loaded from the file if necessarystatic CompletableFuture<PokedexStorage> getStorage(net.minecraft.server.level.ServerPlayer player) Gets the player's pokedex storage waiting until it is loaded from the file if necessarystatic PokeDexStorageManagerGives you the current storage managerstatic PokedexStoragegetStorageNow(UUID uuid) Gets the player's pokedex storagestatic PokedexStoragegetStorageNow(net.minecraft.server.level.ServerPlayer player) Gets the player's pokedex storagestatic voidinvalidateCache(PokedexStorage storage) Removes the storage from the cachestatic voidsetSaveAdapter(PokeDexStorageSaveAdapter saveAdapter) Sets the implementation of the save adapter
Should ideally be set using thePixelmonInitEventstatic voidsetSaveScheduler(PokeDexStorageSaveScheduler saveScheduler) Sets the implementation of the save scheduler
Should ideally be set using thePixelmonInitEventstatic voidsetStorageManager(PokeDexStorageManager 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 cachedPokedexStoragethis 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
-
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
Gets the player's pokedex storage- Parameters:
uuid- The player- Returns:
- The pokedex storage
-
getStorage
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
-