RuneHive-Game
Loading...
Searching...
No Matches
HintArrowTile.java
Go to the documentation of this file.
1package com.runehive.net.packet.out;
2
3import com.runehive.game.world.entity.mob.player.Player;
4import com.runehive.game.world.position.Position;
5import com.runehive.net.packet.OutgoingPacket;
6
7/** Shows the flashing yellow hint arrow pointing at a world tile (317 opcode 254, type=2). */
8public final class HintArrowTile extends OutgoingPacket {
9
10 private static final int OPCODE = 254; // set hint icon (all modes)
11 private final Position pos;
12
14 // 1(type) + 2(x) + 2(y) + 1(z) = 6
15 super(OPCODE, /*capacity*/ 6);
16 this.pos = pos;
17 }
18
19 @Override
20 protected boolean encode(Player player) {
21 builder.writeByte(2); // type=2 (tile location - right on coordinates)
22 builder.writeShort(pos.getX()); // absolute world X
23 builder.writeShort(pos.getY()); // absolute world Y
24 builder.writeByte(40); // height offset in pixels (40 = lower height)
25 return true;
26 }
27}
This class represents a character controlled by a player.
Definition Player.java:125
Represents a single tile on the game world.
Definition Position.java:14
OutgoingPacket(int opcode, int capacity)