Class IntegerNBTHandler

java.lang.Object
com.hrznstudio.titanium.nbthandler.data.IntegerNBTHandler
All Implemented Interfaces:
INBTHandler<Integer>

public class IntegerNBTHandler extends Object implements INBTHandler<Integer>
  • Constructor Details

    • IntegerNBTHandler

      public IntegerNBTHandler()
  • Method Details

    • isClassValid

      public boolean isClassValid(Class<?> aClass)
      Checks if the NBTHanlder can handle a class.
      Specified by:
      isClassValid in interface INBTHandler<Integer>
      Parameters:
      aClass - The class that wants to be checked.
      Returns:
      true if the capability can handle the class or false if it can't.
    • storeToNBT

      public boolean storeToNBT(@Nonnull net.minecraft.nbt.CompoundTag compound, @Nonnull String name, @Nonnull Integer object)
      Stores a value as the given name in the NBT.
      Specified by:
      storeToNBT in interface INBTHandler<Integer>
      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 Integer readFromNBT(@Nonnull net.minecraft.nbt.CompoundTag compound, @Nonnull String name, @Nullable Integer current)
      Reads the value from the NBT to be stored in the Field.
      Specified by:
      readFromNBT in interface INBTHandler<Integer>
      Parameters:
      compound - The NBT that stores all the information.
      name - The name of the object stored in the NBT.
      current - 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.