Advertisement
TitanChase

Untitled

Mar 7th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. @Override
  2. public void readEntityFromNBT(NBTTagCompound compound)
  3. {
  4. super.readEntityFromNBT(compound);
  5. inventory.readFromNBT(compound);
  6. if (compound.hasKey(Names.NBT.TileEntityPosition))
  7. {
  8. int[] pos = compound.getIntArray(Names.NBT.TileEntityPosition);
  9. buildingBlockPos = new BlockPos(pos[0], pos[1], pos[2]);
  10. }
  11. }
  12.  
  13. @Override
  14. public void writeEntityToNBT(NBTTagCompound compound)
  15. {
  16. super.writeEntityToNBT(compound);
  17. inventory.writeToNBT(compound);
  18. if (buildingBlockPos != null)
  19. {
  20. int[] pos =
  21. { buildingBlockPos.getX(), buildingBlockPos.getY(), buildingBlockPos.getZ() };
  22. compound.setIntArray(Names.NBT.TileEntityPosition, pos);
  23. }
  24. }
  25.  
  26. public FactionBuilding getFactionBuilding()
  27. {
  28. return ((TileEntityBuilding) world.getTileEntity(buildingBlockPos)).getFactionBuilding();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement