@Override
 public void write(NetOutput out) throws IOException {
   out.writeString(this.serverId);
   byte encoded[] = this.publicKey.getEncoded();
   out.writeVarInt(encoded.length);
   out.writeBytes(encoded);
   out.writeVarInt(this.verifyToken.length);
   out.writeBytes(this.verifyToken);
 }
  @Override
  public void write(NetOutput out) throws IOException {
    out.writeVarInt(this.entityId);
    out.writeByte(MagicValues.value(Integer.class, this.effect));
    out.writeByte(this.amplifier);
    out.writeVarInt(this.duration);

    int flags = 0;
    if (this.ambient) {
      flags |= 0x1;
    }

    if (this.showParticles) {
      flags |= 0x2;
    }

    out.writeByte(flags);
  }
 @Override
 public void write(NetOutput out) throws IOException {
   out.writeVarInt(this.entityId);
   out.writeDouble(this.x);
   out.writeDouble(this.y);
   out.writeDouble(this.z);
   out.writeByte((byte) (this.yaw * 256 / 360));
   out.writeByte((byte) (this.pitch * 256 / 360));
   out.writeBoolean(this.onGround);
 }
 @Override
 public void write(NetOutput out) throws IOException {
   out.writeVarInt(this.entityId);
   out.writeVarInt(MagicValues.value(Integer.class, this.slot));
   NetUtil.writeItem(out, this.item);
 }
 @Override
 public void write(NetOutput out) throws IOException {
   out.writeFloat(this.health);
   out.writeVarInt(this.food);
   out.writeFloat(this.saturation);
 }