Guest User

TileEntityMiner

a guest
Jul 20th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1.     @Override
  2.     public NBTTagCompound writeToNBT(NBTTagCompound tagCompound){
  3.         super.writeToNBT(tagCompound);
  4.         tagCompound.setFloat("degrees", this.degrees);
  5.         return tagCompound;
  6.     }
  7.    
  8.     @Override
  9.     public void readFromNBT(NBTTagCompound tagCompound){
  10.         super.readFromNBT(tagCompound);
  11.         this.degrees = tagCompound.getInteger("degrees");
  12.     }
  13.    
  14.     @Override
  15.     @Nullable
  16.     public SPacketUpdateTileEntity getUpdatePacket(){
  17.         NBTTagCompound tagCompound = new NBTTagCompound();
  18.         writeToNBT(tagCompound);
  19.         return new SPacketUpdateTileEntity(this.pos, 1, tagCompound);
  20.     }
  21.    
  22.     @Override
  23.     public void onDataPacket(net.minecraft.network.NetworkManager net, net.minecraft.network.play.server.SPacketUpdateTileEntity pkt){
  24.         NBTTagCompound tag = pkt.getNbtCompound();
  25.         readFromNBT(tag);
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment