Class PokeDexStorageProxy
java.lang.Object
com.pixelmonmod.pixelmon.api.pokedex.PokeDexStorageProxy
Static factory for managing pixelmon pokedex storage
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
clearAll()
Clears the cache of all storagesstatic Iterable
<PokedexStorage> Gets all the cachedPokedexStorage
this implementation is storingstatic PokeDexStorageSaveAdapter
Gives you the save adapter of the current storage manager.static PokeDexStorageSaveScheduler
Gives 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 PokeDexStorageManager
Gives you the current storage managerstatic PokedexStorage
getStorageNow
(UUID uuid) Gets the player's pokedex storagestatic PokedexStorage
getStorageNow
(net.minecraft.server.level.ServerPlayer player) Gets the player's pokedex storagestatic void
invalidateCache
(PokedexStorage storage) Removes the storage from the cachestatic void
setSaveAdapter
(PokeDexStorageSaveAdapter saveAdapter) Sets the implementation of the save adapter
Should ideally be set using thePixelmonInitEvent
static void
setSaveScheduler
(PokeDexStorageSaveScheduler saveScheduler) Sets the implementation of the save scheduler
Should ideally be set using thePixelmonInitEvent
static void
setStorageManager
(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 cachedPokedexStorage
this 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
-