Class NBTManager

java.lang.Object
com.hrznstudio.titanium.nbthandler.NBTManager

public class NBTManager extends Object
  • Method Details

    • getInstance

      public static NBTManager getInstance()
    • scanTileClassForAnnotations

      public void scanTileClassForAnnotations(Class<? extends net.minecraft.world.level.block.entity.BlockEntity> entity)
      Scans a BlockEntity class for Save.
      Parameters:
      entity - The BlockEntity class
    • writeTileEntity

      public net.minecraft.nbt.CompoundTag writeTileEntity(net.minecraft.world.level.block.entity.BlockEntity entity, net.minecraft.nbt.CompoundTag compound)
      Writes all the values that have Save annotation to the NBTTagCompound.
      Parameters:
      entity - The tile entity instance.
      compound - The NBTTagCompound to save the values.
      Returns:
      the modified NBTTagCompound.
    • readTileEntity

      public void readTileEntity(net.minecraft.world.level.block.entity.BlockEntity entity, net.minecraft.nbt.CompoundTag compound)
      Reads all the values from the NBTTagCompound and saves it to the Fields.
      Parameters:
      entity - The tile entity instance.
      compound - The NBTTagCompound to save the values.
    • writeTileEntityObject

      public net.minecraft.nbt.CompoundTag writeTileEntityObject(net.minecraft.world.level.block.entity.BlockEntity entity, Object object, net.minecraft.nbt.CompoundTag compound)
      Writes an specific object to be synced to the client
      Parameters:
      entity - The tile entity instance
      object - The object to be synced
      compound - The NBTTagCompound to save the values
      Returns:
      the modified NBTTagCompound.
    • getHandlerList

      public List<INBTHandler> getHandlerList()
    • getTileFieldList

      public HashMap<Class<? extends net.minecraft.world.level.block.entity.BlockEntity>,List<Field>> getTileFieldList()