public interface INBTHandler<T>
| Modifier and Type | Method and Description |
|---|---|
boolean |
isClassValid(java.lang.Class<?> aClass)
Checks if the NBTHandler can handle a class.
|
T |
readFromNBT(net.minecraft.nbt.CompoundNBT compound,
java.lang.String name,
T currentValue)
Reads the value from the NBT to be stored in the Field.
|
boolean |
storeToNBT(net.minecraft.nbt.CompoundNBT compound,
java.lang.String name,
T object)
Stores a value as the given name in the NBT.
|
boolean isClassValid(java.lang.Class<?> aClass)
aClass - The class that wants to be checked.boolean storeToNBT(@Nonnull
net.minecraft.nbt.CompoundNBT compound,
@Nonnull
java.lang.String name,
@Nonnull
T object)
compound - The NBT where the object needs to be stored.name - The name as it will be stored.object - The object value to be stored.T readFromNBT(@Nonnull net.minecraft.nbt.CompoundNBT compound, @Nonnull java.lang.String name, @Nullable T currentValue)
compound - The NBT that stores all the information.name - The name of the object stored in the NBT.currentValue - The current value of the object