Package io.netty.buffer

Examples of io.netty.buffer.ByteBuf.writeByte()


  @Override
  public ByteBuf encode(PlayerLookMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(9);
    buffer.writeFloat(-message.getYaw());
    buffer.writeFloat(message.getPitch());
    buffer.writeByte(message.isOnGround() ? 1 : 0);
    return buffer;
  }
}
View Full Code Here


  }

  @Override
  public ByteBuf encode(WindowTransactionMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(4);
    buffer.writeByte(message.getWindowInstanceId());
    buffer.writeShort(message.getTransaction());
    buffer.writeByte(message.isAccepted() ? 1 : 0);
    return buffer;
  }
}
View Full Code Here

  @Override
  public ByteBuf encode(WindowTransactionMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(4);
    buffer.writeByte(message.getWindowInstanceId());
    buffer.writeShort(message.getTransaction());
    buffer.writeByte(message.isAccepted() ? 1 : 0);
    return buffer;
  }
}
View Full Code Here

    buffer.writeInt(message.getEntityId());
    VanillaByteBufUtils.writeString(buffer, message.getName());
    buffer.writeInt(message.getX());
    buffer.writeInt(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeByte(message.getYaw());
    buffer.writeByte(message.getPitch());
    buffer.writeShort(message.getId());
    VanillaByteBufUtils.writeParameters(buffer, message.getParameters());
    return buffer;
  }
View Full Code Here

  @Override
  public ByteBuf encode(PlayerBedMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(14);
    buffer.writeInt(message.getEntityId());
    buffer.writeByte(message.getUsed());
    buffer.writeInt(message.getX());
    buffer.writeByte(message.getY());
    buffer.writeInt(message.getZ());
    return buffer;
  }
View Full Code Here

    VanillaByteBufUtils.writeString(buffer, message.getName());
    buffer.writeInt(message.getX());
    buffer.writeInt(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeByte(message.getYaw());
    buffer.writeByte(message.getPitch());
    buffer.writeShort(message.getId());
    VanillaByteBufUtils.writeParameters(buffer, message.getParameters());
    return buffer;
  }
}
View Full Code Here

  public ByteBuf encode(PlayerBedMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(14);
    buffer.writeInt(message.getEntityId());
    buffer.writeByte(message.getUsed());
    buffer.writeInt(message.getX());
    buffer.writeByte(message.getY());
    buffer.writeInt(message.getZ());
    return buffer;
  }
}
View Full Code Here

  @Override
  public ByteBuf encode(EffectMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(18);
    buffer.writeInt(message.getId());
    buffer.writeInt(message.getX());
    buffer.writeByte(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeInt(message.getData());
    buffer.writeByte(message.hasVolumeDecrease() ? 1 : 0);
    return buffer;
  }
View Full Code Here

  @Override
  public ByteBuf encode(WindowItemsMessage message) throws IOException {
    ItemStack[] items = message.getItems();
    ByteBuf buffer = Unpooled.buffer();
    buffer.writeByte(message.getWindowInstanceId());
    buffer.writeShort(items.length);
    for (ItemStack item : items) {
      VanillaByteBufUtils.writeItemStack(buffer, item);
    }
    return buffer;
View Full Code Here

    buffer.writeInt(message.getId());
    buffer.writeInt(message.getX());
    buffer.writeByte(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeInt(message.getData());
    buffer.writeByte(message.hasVolumeDecrease() ? 1 : 0);
    return buffer;
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.