Class NBTStorageSaveAdapter
java.lang.Object
com.pixelmonmod.pixelmon.storage.adapters.NBTStorageSaveAdapter
- All Implemented Interfaces:
FlatFileStorageSaveAdapter
,StorageSaveAdapter
public class NBTStorageSaveAdapter
extends Object
implements StorageSaveAdapter, FlatFileStorageSaveAdapter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetFile
(PokemonStorage storage) <T extends PokemonStorage>
CompletableFuture<T>Loads the specified type ofPokemonStorage
saved under the specified UUID.void
save
(PokemonStorage storage) Saves the givenPokemonStorage
into persistent data.
-
Constructor Details
-
NBTStorageSaveAdapter
public NBTStorageSaveAdapter()
-
-
Method Details
-
getFile
- Specified by:
getFile
in interfaceFlatFileStorageSaveAdapter
-
save
Description copied from interface:StorageSaveAdapter
Saves the givenPokemonStorage
into persistent data. The UUID and storage type can be derived from the parameter.- Specified by:
save
in interfaceStorageSaveAdapter
- Parameters:
storage
- ThePokemonStorage
that must be saved.
-
load
Description copied from interface:StorageSaveAdapter
Loads the specified type ofPokemonStorage
saved 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.- Specified by:
load
in interfaceStorageSaveAdapter
- Parameters:
uuid
- The UUID of the storage to load. This is typically a player UUID, but it's possible that customPokemonStorage
implementations work differently.clazz
- The class ofPokemonStorage
that must be loaded. In a normal context, this will only includePlayerPartyStorage
instances andPCStorage
instances, but if a custom storage manager is in use then it is possible other classes will be passed into this.
-