RuneHive-Game
Loading...
Searching...
No Matches
SendToggle.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.net.codec.ByteOrder;
5import com.runehive.net.packet.OutgoingPacket;
6
7public final class SendToggle extends OutgoingPacket {
8
9 private final int id;
10 private final int value;
11
12 public SendToggle(int id, int value) {
13 super(87, 6);
14 this.id = id;
15 this.value = value;
16 }
17
18 @Override
19 protected boolean encode(Player player) {
20 builder.writeShort(id, ByteOrder.LE)
21 .writeInt(value, ByteOrder.ME);
22 return true;
23 }
24
25}
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.
ME
Represents Middle-endian.