Package io.netty.buffer

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


  public ByteBuf encode(EntityVelocityMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(10);
    buffer.writeInt(message.getEntityId());
    buffer.writeShort(message.getVelocityX());
    buffer.writeShort(message.getVelocityY());
    buffer.writeShort(message.getVelocityZ());
    return buffer;
  }
}
View Full Code Here


  public ByteBuf encode(PlayerRespawnMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer();
    buffer.writeInt(message.getDimension());
    buffer.writeByte(message.getDifficulty());
    buffer.writeByte(message.getGameMode());
    buffer.writeShort(message.getWorldHeight());
    VanillaByteBufUtils.writeString(buffer, message.getWorldType());
    return buffer;
  }
}
View Full Code Here

  @Override
  public ByteBuf encode(WindowPropertyMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(5);
    buffer.writeByte(message.getWindowInstanceId());
    buffer.writeShort(message.getProgressBar());
    buffer.writeShort(message.getValue());
    return buffer;
  }
}
View Full Code Here

  @Override
  public ByteBuf encode(WindowPropertyMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(5);
    buffer.writeByte(message.getWindowInstanceId());
    buffer.writeShort(message.getProgressBar());
    buffer.writeShort(message.getValue());
    return buffer;
  }
}
View Full Code Here

  }

  @Override
  public ByteBuf encode(PlayerHeldItemChangeMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(2);
    buffer.writeShort(message.getSlot());
    return buffer;
  }
}
View Full Code Here

  @Override
  public ByteBuf encode(WindowClickMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer();
    buffer.writeByte(message.getWindowInstanceId());
    buffer.writeShort(message.getSlot());
    buffer.writeByte(message.getButton());
    buffer.writeShort(message.getTransaction());
    buffer.writeByte(message.getMode());
    VanillaByteBufUtils.writeItemStack(buffer, message.get());
    return buffer;
View Full Code Here

  public ByteBuf encode(WindowClickMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer();
    buffer.writeByte(message.getWindowInstanceId());
    buffer.writeShort(message.getSlot());
    buffer.writeByte(message.getButton());
    buffer.writeShort(message.getTransaction());
    buffer.writeByte(message.getMode());
    VanillaByteBufUtils.writeItemStack(buffer, message.get());
    return buffer;
  }
}
View Full Code Here

  @Override
  public ByteBuf encode(ServerPluginMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer();
    VanillaByteBufUtils.writeString(buffer, message.getType());
    buffer.writeShort(message.getData().length);
    buffer.writeBytes(message.getData());
    return buffer;
  }
}
View Full Code Here

  @Override
  public ByteBuf encode(EntityEquipmentMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer();
    buffer.writeInt(message.getEntityId());
    buffer.writeShort(message.getSlot());
    VanillaByteBufUtils.writeItemStack(buffer, message.get());
    return buffer;
  }
}
View Full Code Here

  }

  @Override
  public ByteBuf encode(EntityItemDataMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer();
    buffer.writeShort(message.getType());
    buffer.writeShort(message.getId());
    buffer.writeShort(message.getData().length);
    buffer.writeBytes(message.getData());
    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.