Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void writeToNBT(NBTTagCompound compound)
- {
- super.writeToNBT(compound);
- if (itemStack != null){
- compound.setTag("heldItem", itemStack.writeToNBT(new NBTTagCompound()));
- }
- }
- public void readFromNBT(NBTTagCompound compound)
- {
- super.readFromNBT(compound);
- if (compound.getCompoundTag("heldItem") != null){
- itemStack = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("heldItem"));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement