Class ResearchStorageProxy
java.lang.Object
com.pixelmonmod.pixelmon.api.storage.research.ResearchStorageProxy
Static factory for managing pixelmon research storage
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
clearAll()
Clears the cache of all storagesstatic Iterable<ResearchStorage>
Gets all the cachedPokemonStorage
this implementation is storingstatic ResearchStorageSaveAdapter
Gives you the save adapter of the current storage manager.static ResearchStorageSaveScheduler
Gives you the save scheduler of the current storage manager.static CompletableFuture<ResearchStorage>
getStorage
(UUID uuid) Gets the player's research storage waiting until it is loaded from the file if necessarystatic CompletableFuture<ResearchStorage>
getStorage
(net.minecraft.server.level.ServerPlayer player) Gets the player's research storage waiting until it is loaded from the file if necessarystatic ResearchStorageManager
Gives you the current storage managerstatic ResearchStorage
getStorageNow
(UUID uuid) Gets the player's research storagestatic ResearchStorage
getStorageNow
(net.minecraft.server.level.ServerPlayer player) Gets the player's research storagestatic void
invalidateCache
(ResearchStorage storage) Removes the storage from the cachestatic void
setSaveAdapter
(ResearchStorageSaveAdapter saveAdapter) Sets the implementation of the save adapter
Should ideally be set using thePixelmonInitEvent
static void
setSaveScheduler
(ResearchStorageSaveScheduler saveScheduler) Sets the implementation of the save scheduler
Should ideally be set using thePixelmonInitEvent
static void
setStorageManager
(ResearchStorageManager 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 cachedPokemonStorage
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 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
Gets the player's research storage- Parameters:
uuid
- The player- Returns:
- The research storage
-
getStorage
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
-