Advertisement
Guest User

Untitled

a guest
Jul 13th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. public void writeCustomNBT(NBTTagCompound tag)
  2. {
  3. face = ForgeDirection.getOrientation(this.getBlockMetadata());
  4. tag.setInteger("face", this.face.ordinal());
  5. tag.setInteger("amount", amount);
  6. }
  7.  
  8. public void readCustomNBT(NBTTagCompound tag)
  9. {
  10. face = ForgeDirection.getOrientation(this.getBlockMetadata());
  11. this.face = ForgeDirection.getOrientation(tag.getInteger("face"));
  12. this.amount = tag.getInteger("amount");
  13. }
  14.  
  15.  
  16. @Override
  17. public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
  18. readFromNBT(pkt.func_148857_g());
  19. worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
  20. }
  21.  
  22. @Override
  23. public Packet getDescriptionPacket() {
  24. NBTTagCompound nbttagcompound = new NBTTagCompound();
  25. this.writeToNBT(nbttagcompound);
  26. return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, nbttagcompound);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement