Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void readEntityFromNBT(NBTTagCompound compound)
- {
- super.readEntityFromNBT(compound);
- inventory.readFromNBT(compound);
- if (compound.hasKey(Names.NBT.TileEntityPosition))
- {
- int[] pos = compound.getIntArray(Names.NBT.TileEntityPosition);
- BlockPos blockPos = new BlockPos(pos[0], pos[1], pos[2]);
- building = (TileEntityBuilding) world.getTileEntity(blockPos);
- }
- }
- @Override
- public void writeEntityToNBT(NBTTagCompound compound)
- {
- super.writeEntityToNBT(compound);
- inventory.writeToNBT(compound);
- if (building != null)
- {
- int[] pos =
- { building.getPos().getX(), building.getPos().getY(), building.getPos().getZ() };
- compound.setIntArray(Names.NBT.TileEntityPosition, pos);
- }
- }
Add Comment
Please, Sign In to add comment