Package io.netty.buffer

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


    ByteBuf buffer = Unpooled.buffer();
    buffer.writeDouble(message.getX());
    buffer.writeDouble(message.getY());
    buffer.writeDouble(message.getZ());
    buffer.writeFloat(message.getRadius());
    buffer.writeInt(message.getRecords());
    buffer.writeBytes(message.getCoordinates());
    buffer.writeFloat(0.0f); // unknown (x?)
    buffer.writeFloat(0.0f); // unknown (y?)
    buffer.writeFloat(0.0f); // unknown (z?)
    return buffer;
View Full Code Here


  @Override
  public ByteBuf encode(PlayerDiggingMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(11);
    buffer.writeByte(message.getState());
    buffer.writeInt(message.getX());
    buffer.writeByte(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeByte(BlockFaces.BTEWNS.indexOf(message.getFace(), 0));
    return buffer;
  }
View Full Code Here

  public ByteBuf encode(PlayerDiggingMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(11);
    buffer.writeByte(message.getState());
    buffer.writeInt(message.getX());
    buffer.writeByte(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeByte(BlockFaces.BTEWNS.indexOf(message.getFace(), 0));
    return buffer;
  }
}
View Full Code Here

  }

  @Override
  public ByteBuf encode(PlayerSpawnMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer();
    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());
View Full Code Here

  @Override
  public ByteBuf encode(PlayerSpawnMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer();
    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());
View Full Code Here

    buffer.writeFloat(message.getZ());
    buffer.writeFloat(message.getXOffset());
    buffer.writeFloat(message.getYOffset());
    buffer.writeFloat(message.getZOffset());
    buffer.writeFloat(message.getVelocity());
    buffer.writeInt(message.getAmount());
    return buffer;
  }
}
View Full Code Here

  public ByteBuf encode(PlayerSpawnMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer();
    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());
View Full Code Here

    ByteBuf buffer = Unpooled.buffer();
    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

  @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

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.