Class EnumNBTHandler<E extends Enum<E>>
java.lang.Object
com.hrznstudio.titanium.nbthandler.data.EnumNBTHandler<E>
- All Implemented Interfaces:
INBTHandler<E>
- Direct Known Subclasses:
EnumDyeColorNBTHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract EgetFromId(int id) protected abstract intfinal EreadFromNBT(net.minecraft.nbt.CompoundTag compound, String name, E currentValue) Reads the value from the NBT to be stored in the Field.final booleanstoreToNBT(net.minecraft.nbt.CompoundTag compound, String name, E object) Stores a value as the given name in the NBT.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hrznstudio.titanium.api.INBTHandler
isClassValid
-
Constructor Details
-
EnumNBTHandler
public EnumNBTHandler()
-
-
Method Details
-
getIdFrom
-
getFromId
-
storeToNBT
public final boolean storeToNBT(@Nonnull net.minecraft.nbt.CompoundTag compound, @Nonnull String name, @Nonnull E object) Description copied from interface:INBTHandlerStores a value as the given name in the NBT.- Specified by:
storeToNBTin interfaceINBTHandler<E extends Enum<E>>- Parameters:
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.- Returns:
- true if the Object was successfully stored in the NBT
-
readFromNBT
public final E readFromNBT(@Nonnull net.minecraft.nbt.CompoundTag compound, @Nonnull String name, @Nullable E currentValue) Description copied from interface:INBTHandlerReads the value from the NBT to be stored in the Field.- Specified by:
readFromNBTin interfaceINBTHandler<E extends Enum<E>>- Parameters:
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- Returns:
- The object if it was successfully stored or null if it wasn't giving the next handlers a chance to store the value.
-