Interface INBTSerializable
- All Known Subinterfaces:
INBTInventory
- All Known Implementing Classes:
IndexedInventory
,LargeInventory
,NBTSimpleInventoryItemHeld
,NBTSimpleInventoryItemStack
,SimpleInventory
public interface INBTSerializable
Objects that are serializable to NBT.
Classes implementing must have a public default constructor which will be used
for NBT reading instantiation.
-
Nested Class Summary
-
Method Summary
-
Method Details
-
toNBT
net.minecraft.nbt.CompoundTag toNBT()Convert the data to an NBT tag.- Returns:
- The NBT tag.
-
fromNBT
void fromNBT(net.minecraft.nbt.CompoundTag tag) Read the data from an NBT tag and place it in this object. The given tag will never be null, so make sure that all fields have a correct default value in case the received tag would be null anyways.- Parameters:
tag
- The tag to read from.
-