Package io.netty.buffer

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


  @Override
  public ByteBuf encode(EntityObjectMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(message.getThrowerId() > 0 ? 29 : 23);
    buffer.writeInt(message.getEntityId());
    buffer.writeByte(message.getType());
    buffer.writeInt(message.getX());
    buffer.writeInt(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeByte(message.getYaw());
    buffer.writeByte(message.getPitch());
    int throwerId = message.getThrowerId();
View Full Code Here


  public ByteBuf encode(EntityObjectMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(message.getThrowerId() > 0 ? 29 : 23);
    buffer.writeInt(message.getEntityId());
    buffer.writeByte(message.getType());
    buffer.writeInt(message.getX());
    buffer.writeInt(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeByte(message.getYaw());
    buffer.writeByte(message.getPitch());
    int throwerId = message.getThrowerId();
    buffer.writeInt(throwerId);
View Full Code Here

    ByteBuf buffer = Unpooled.buffer(message.getThrowerId() > 0 ? 29 : 23);
    buffer.writeInt(message.getEntityId());
    buffer.writeByte(message.getType());
    buffer.writeInt(message.getX());
    buffer.writeInt(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeByte(message.getYaw());
    buffer.writeByte(message.getPitch());
    int throwerId = message.getThrowerId();
    buffer.writeInt(throwerId);
    if (throwerId > 0) {
View Full Code Here

  public ByteBuf encode(PlayerHandshakeMessage message) {
    ByteBuf buffer = Unpooled.buffer();
    buffer.writeByte(message.getProtocolVersion());
    VanillaByteBufUtils.writeString(buffer, message.getUsername());
    VanillaByteBufUtils.writeString(buffer, message.getHostname());
    buffer.writeInt(message.getPort());
    return buffer;
  }
}
View Full Code Here

    buffer.writeInt(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeByte(message.getYaw());
    buffer.writeByte(message.getPitch());
    int throwerId = message.getThrowerId();
    buffer.writeInt(throwerId);
    if (throwerId > 0) {
      buffer.writeShort(message.getSpeedX());
      buffer.writeShort(message.getSpeedY());
      buffer.writeShort(message.getSpeedZ());
    }
View Full Code Here

  }

  @Override
  public ByteBuf encode(BlockChangeMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(12);
    buffer.writeInt(message.getX());
    buffer.writeByte(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeShort(message.getType());
    buffer.writeByte(message.getMetadata());
    return buffer;
View Full Code Here

  @Override
  public ByteBuf encode(BlockChangeMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(12);
    buffer.writeInt(message.getX());
    buffer.writeByte(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeShort(message.getType());
    buffer.writeByte(message.getMetadata());
    return buffer;
  }
}
View Full Code Here

  }

  @Override
  public ByteBuf encode(PlayerPingMessage message) {
    ByteBuf buffer = Unpooled.buffer(4);
    buffer.writeInt(message.getPingId());
    return buffer;
  }
}
View Full Code Here

  }

  @Override
  public ByteBuf encode(BlockBreakAnimationMessage msg) throws IOException {
    ByteBuf buffer = Unpooled.buffer(17);
    buffer.writeInt(msg.getEntityId());
    buffer.writeInt(msg.getX());
    buffer.writeInt(msg.getY());
    buffer.writeInt(msg.getZ());
    buffer.writeByte(msg.getStage());
    return buffer;
View Full Code Here

  @Override
  public ByteBuf encode(BlockBreakAnimationMessage msg) throws IOException {
    ByteBuf buffer = Unpooled.buffer(17);
    buffer.writeInt(msg.getEntityId());
    buffer.writeInt(msg.getX());
    buffer.writeInt(msg.getY());
    buffer.writeInt(msg.getZ());
    buffer.writeByte(msg.getStage());
    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.