RuneHive-Game
Loading...
Searching...
No Matches
SendMoveComponent.java
Go to the documentation of this file.
1package com.runehive.net.packet.out;
2
3import com.runehive.net.codec.ByteOrder;
4import com.runehive.game.world.entity.mob.player.Player;
5import com.runehive.net.packet.OutgoingPacket;
6
7public class SendMoveComponent extends OutgoingPacket {
8
9 private final int id;
10 private final int x, y;
11
12 public SendMoveComponent(int x, int y, int id) {
13 super(70, 6);
14 this.x = x;
15 this.y = y;
16 this.id = id;
17 }
18
19 @Override
20 public boolean encode(Player player) {
21 builder.writeShort(x)
22 .writeShort(y, ByteOrder.LE)
23 .writeShort(id, ByteOrder.LE);
24 return true;
25 }
26
27}
This class represents a character controlled by a player.
Definition Player.java:125
OutgoingPacket(int opcode, int capacity)
Represents the order in which bytes are written.
Definition ByteOrder.java:8
LE
Represents Little-endian.