use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class DisplayTabInterfaceMessageEncoder method encode.
@Override
public GamePacket encode(DisplayTabInterfaceMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(106);
builder.put(DataType.BYTE, DataTransformation.NEGATE, message.getTab());
return builder.toGamePacket();
}
use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class DisplayCrossbonesMessageEncoder method encode.
@Override
public GamePacket encode(DisplayCrossbonesMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(61);
builder.put(DataType.BYTE, message.isDisplayed() ? 1 : 0);
return builder.toGamePacket();
}
use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class AddGlobalTileItemMessageEncoder method encode.
@Override
public GamePacket encode(SendPublicTileItemMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(215);
builder.put(DataType.SHORT, DataTransformation.ADD, message.getId());
builder.put(DataType.BYTE, DataTransformation.SUBTRACT, message.getPositionOffset());
builder.put(DataType.SHORT, DataTransformation.ADD, message.getIndex());
builder.put(DataType.SHORT, message.getAmount());
return builder.toGamePacket();
}
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(44);
builder.put(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD, message.getId());
builder.put(DataType.SHORT, message.getAmount());
builder.put(DataType.BYTE, message.getPositionOffset());
return builder.toGamePacket();
}
use of org.apollo.net.codec.game.GamePacketBuilder in project apollo by apollo-rsps.
the class RegionChangeMessageEncoder method encode.
@Override
public GamePacket encode(RegionChangeMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(222);
builder.put(DataType.SHORT, message.getPosition().getCentralRegionY());
builder.put(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD, message.getPosition().getCentralRegionX());
return builder.toGamePacket();
}
Aggregations