Interface StorageSaveAdapter
- All Known Subinterfaces:
FlatFileStorageSaveAdapter
- All Known Implementing Classes:
NBTStorageSaveAdapter
public interface StorageSaveAdapter
Interface for the persistence adapter of
never returns null.
Both the save and load methods must work for all
This class will be registered on the Forge event bus by the
PokemonStorages. The only provided
implementation is the NBTStorageSaveAdapter which writes into the traditional
.pk and .comp files. However, custom implementations can handle this in any way as
long as
invalid reference
#load(UUID, Class)
Both the save and load methods must work for all
PokemonStorages. This class will be registered on the Forge event bus by the
Pixelmon class
after the PixelmonInitEvent- Since:
- September 5, 2018 (Pixelmon 7.0.0)
-
Method Summary
Modifier and TypeMethodDescription<T extends PokemonStorage>
CompletableFuture<T> Loads the specified type ofPokemonStoragesaved under the specified UUID.voidsave(PokemonStorage storage, net.minecraft.core.HolderLookup.Provider registryAccess) Saves the givenPokemonStorageinto persistent data.
-
Method Details
-
save
Saves the givenPokemonStorageinto persistent data. The UUID and storage type can be derived from the parameter.- Parameters:
storage- ThePokemonStoragethat must be saved.
-
load
@Nonnull <T extends PokemonStorage> CompletableFuture<T> load(UUID uuid, Class<T> clazz, net.minecraft.core.HolderLookup.Provider registryAccess) Loads the specified type ofPokemonStoragesaved under the specified UUID. The returned value must not be null. If a storage for the UUID and class does not already exist, it must be created and returned.- Parameters:
uuid- The UUID of the storage to load. This is typically a player UUID, but it's possible that customPokemonStorageimplementations work differently.clazz- The class ofPokemonStoragethat must be loaded. In a normal context, this will only includePlayerPartyStorageinstances andPCStorageinstances, but if a custom storage manager is in use then it is possible other classes will be passed into this.
-