Advertisement
Bibouche

Untitled

Jul 21st, 2021
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1.     public void read(BlockState state, CompoundNBT nbt) {
  2.         super.read(state, nbt);
  3.         inv.deserializeNBT(nbt.getCompound("Inv"));
  4.     }
  5.  
  6.     @Nullable
  7.     @Override
  8.     public SUpdateTileEntityPacket getUpdatePacket() {
  9.         return new SUpdateTileEntityPacket(this.pos, -1, getUpdateTag());
  10.     }
  11.  
  12.     @Override
  13.     public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) {
  14.         handleUpdateTag(world.getBlockState(pkt.getPos()), pkt.getNbtCompound());
  15.     }
  16.  
  17.     @Override
  18.     public CompoundNBT getUpdateTag() {
  19.         CompoundNBT nbt = super.getUpdateTag();
  20.         nbt.put("Inv", inv.serializeNBT());
  21.         return nbt;
  22.     }
  23.  
  24.     @Override
  25.     public void handleUpdateTag(BlockState state, CompoundNBT tag) {
  26.         this.read(state, tag);
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement