Class AutoSaveData<T>
java.lang.Object
dev.scsupercraft.mc.libraries.corelib.api.data.SaveData<T>
dev.scsupercraft.mc.libraries.corelib.api.data.AutoSaveData<T>
- Type Parameters:
T- The type of the data being saved.
- All Implemented Interfaces:
Data<T>
- Direct Known Subclasses:
SyncedAutoSaveData
@AvailableSince("1.0.0")
public sealed class AutoSaveData<T>
extends SaveData<T>
permits SyncedAutoSaveData<T>
A helper class for save data.
Automatically saves and loads data.
-
Nested Class Summary
Nested classes/interfaces inherited from class dev.scsupercraft.mc.libraries.corelib.api.data.SaveData
SaveData.Type -
Constructor Summary
ConstructorsConstructorDescriptionAutoSaveData(Supplier<@NotNull T> defaultValue, CodecHolder<T> codecHolder, Supplier<File> fileGetter, SaveData.Type type) Creates new auto save data. -
Method Summary
-
Constructor Details
-
AutoSaveData
@AvailableSince("1.0.0") public AutoSaveData(Supplier<@NotNull T> defaultValue, CodecHolder<T> codecHolder, Supplier<File> fileGetter, SaveData.Type type) Creates new auto save data.- Parameters:
defaultValue- A supplier that returns the default value for this savable. Used if there isn't any existing data during loading.codecHolder- A codec holder for serializing the save data.fileGetter- A supplier that returns the file that the data will be saved to.type- What should the data be saved as.
-
-
Method Details