use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class AddTileItemMessageEncoder method encode.
@Override
public GamePacket encode(SendTileItemMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(107);
builder.put(DataType.SHORT, message.getId());
builder.put(DataType.BYTE, DataTransformation.NEGATE, message.getPositionOffset());
builder.put(DataType.SHORT, DataTransformation.ADD, message.getAmount());
return builder.toGamePacket();
}
use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class UpdateSkillMessageEncoder method encode.
@Override
public GamePacket encode(UpdateSkillMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(134);
Skill skill = message.getSkill();
builder.put(DataType.BYTE, message.getId());
builder.put(DataType.INT, DataOrder.MIDDLE, (int) skill.getExperience());
builder.put(DataType.BYTE, skill.getCurrentLevel());
return builder.toGamePacket();
}
use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class SetPlayerActionMessageEncoder method encode.
@Override
public GamePacket encode(SetPlayerActionMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(104, PacketType.VARIABLE_BYTE);
builder.put(DataType.BYTE, DataTransformation.NEGATE, message.getSlot());
builder.put(DataType.BYTE, DataTransformation.ADD, message.isPrimaryAction() ? 0 : 1);
builder.putString(message.getText());
return builder.toGamePacket();
}
use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class SetWidgetModelMessageEncoder method encode.
@Override
public GamePacket encode(SetWidgetModelMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(8);
builder.put(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD, message.getInterfaceId());
builder.put(DataType.SHORT, message.getModel());
return builder.toGamePacket();
}
use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class SetWidgetPlayerModelMessageEncoder method encode.
@Override
public GamePacket encode(SetWidgetPlayerModelMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(185);
builder.put(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD, message.getInterfaceId());
return builder.toGamePacket();
}
Aggregations