Example #1
0
 @Override
 public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) throws IOException {
   ByteBufOutputStream bos = new ByteBufOutputStream(buffer);
   bos.writeInt(x);
   bos.writeInt(y);
   bos.writeInt(z);
   NBTHelper.nbtWrite(tag, bos);
 }
Example #2
0
 @Override
 public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) throws IOException {
   ByteBufInputStream bis = new ByteBufInputStream(buffer);
   x = bis.readInt();
   y = bis.readInt();
   z = bis.readInt();
   DataInputStream dis = new DataInputStream(bis);
   tag = NBTHelper.nbtRead(dis);
 }