RuneHive-Game
Loading...
Searching...
No Matches
SendCoordinate.java
Go to the documentation of this file.
1package com.runehive.net.packet.out;
2
3import com.runehive.net.codec.ByteModification;
4import com.runehive.game.world.entity.mob.player.Player;
5import com.runehive.game.world.position.Position;
6import com.runehive.net.packet.OutgoingPacket;
7
8public class SendCoordinate extends OutgoingPacket {
9
10 private final Position position;
11
13 super(85, 2);
14 this.position = position;
15 }
16
17 @Override
18 public boolean encode(Player player) {
19 final int y = position.getLocalY(player.lastPosition);
20 final int x = position.getLocalX(player.lastPosition);
21 builder.writeByte(y, ByteModification.NEG);
22 builder.writeByte(x, ByteModification.NEG);
23 return true;
24 }
25
26}
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)
Represents RuneScape's custom value types.