use of org.apollo.game.message.impl.HintIconMessage.Type in project apollo by apollo-rsps.
the class PositionHintIconMessageEncoder method encode.
@Override
public GamePacket encode(PositionHintIconMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(254);
HintIconMessage.Type type = message.getType();
if (type == Type.PLAYER || type == Type.NPC) {
throw new IllegalStateException("Unsupported hint icon type " + type + ".");
}
builder.put(DataType.BYTE, type.getValue());
Position position = message.getPosition();
builder.put(DataType.SHORT, position.getX());
builder.put(DataType.SHORT, position.getY());
builder.put(DataType.BYTE, message.getHeight());
return builder.toGamePacket();
}
use of org.apollo.game.message.impl.HintIconMessage.Type in project apollo by apollo-rsps.
the class PositionHintIconMessageEncoder method encode.
@Override
public GamePacket encode(PositionHintIconMessage message) {
GamePacketBuilder builder = new GamePacketBuilder(199);
HintIconMessage.Type type = message.getType();
if (type == Type.PLAYER || type == Type.NPC) {
throw new IllegalStateException("Unsupported hint icon type " + type + ".");
}
builder.put(DataType.BYTE, type.getValue());
Position position = message.getPosition();
builder.put(DataType.SHORT, position.getX());
builder.put(DataType.SHORT, position.getY());
builder.put(DataType.BYTE, message.getHeight());
return builder.toGamePacket();
}
Aggregations