public abstract class EnumNBTHandler<E extends java.lang.Enum<E>> extends java.lang.Object implements INBTHandler<E>
| Constructor and Description |
|---|
EnumNBTHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract E |
getFromId(int id) |
protected abstract int |
getIdFrom(E obj) |
E |
readFromNBT(net.minecraft.nbt.CompoundNBT compound,
java.lang.String name,
E currentValue)
Reads the value from the NBT to be stored in the Field.
|
boolean |
storeToNBT(net.minecraft.nbt.CompoundNBT compound,
java.lang.String name,
E object)
Stores a value as the given name in the NBT.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisClassValidprotected abstract int getIdFrom(E obj)
protected abstract E getFromId(int id)
public final boolean storeToNBT(@Nonnull
net.minecraft.nbt.CompoundNBT compound,
@Nonnull
java.lang.String name,
@Nonnull
E object)
INBTHandlerstoreToNBT in interface INBTHandler<E extends java.lang.Enum<E>>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.public final E readFromNBT(@Nonnull net.minecraft.nbt.CompoundNBT compound, @Nonnull java.lang.String name, @Nullable E currentValue)
INBTHandlerreadFromNBT in interface INBTHandler<E extends java.lang.Enum<E>>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