Class NBTManager
java.lang.Object
com.hrznstudio.titanium.nbthandler.NBTManager
-
Method Summary
Modifier and TypeMethodDescriptionstatic NBTManagervoidreadTileEntity(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.voidscanTileClassForAnnotations(Class<? extends net.minecraft.world.level.block.entity.BlockEntity> entity) Scans aBlockEntityclass forSave.net.minecraft.nbt.CompoundTagwriteTileEntity(net.minecraft.world.level.block.entity.BlockEntity entity, net.minecraft.nbt.CompoundTag compound) Writes all the values that haveSaveannotation to the NBTTagCompound.net.minecraft.nbt.CompoundTagwriteTileEntityObject(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
-
Method Details
-
getInstance
-
scanTileClassForAnnotations
public void scanTileClassForAnnotations(Class<? extends net.minecraft.world.level.block.entity.BlockEntity> entity) Scans aBlockEntityclass forSave.- 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 haveSaveannotation 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 instanceobject- The object to be syncedcompound- The NBTTagCompound to save the values- Returns:
- the modified NBTTagCompound.
-
getHandlerList
-
getTileFieldList
-