use of org.apollo.game.message.impl.SwitchItemMessage in project apollo by apollo-rsps.
the class SwitchItemMessageDecoder method decode.
@Override
public SwitchItemMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int newSlot = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
boolean inserting = reader.getUnsigned(DataType.BYTE, DataTransformation.ADD) == 1;
int interfaceId = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
int oldSlot = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
return new SwitchItemMessage(interfaceId, inserting, oldSlot, newSlot);
}
use of org.apollo.game.message.impl.SwitchItemMessage in project apollo by apollo-rsps.
the class SwitchItemMessageDecoder method decode.
@Override
public SwitchItemMessage decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int interfaceId = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
boolean inserting = reader.getUnsigned(DataType.BYTE, DataTransformation.NEGATE) == 1;
int oldSlot = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
int newSlot = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
return new SwitchItemMessage(interfaceId, inserting, oldSlot, newSlot);
}
Aggregations