RuneHive-Game
Loading...
Searching...
No Matches
SendFont.java
Go to the documentation of this file.
1package com.runehive.net.packet.out;
2
3import com.runehive.net.codec.ByteModification;
4import com.runehive.net.codec.ByteOrder;
5import com.runehive.game.world.entity.mob.player.Player;
6import com.runehive.net.packet.OutgoingPacket;
7
8/**
9 * The {@code OutgoingPacket} that sends a font to a string
10 * in the client.
11 *
12 * @author Daniel | Obey
13 */
14public class SendFont extends OutgoingPacket {
15
16 private final int id;
17 private final int font;
18
19 public SendFont(int id, int font) {
20 super(123, 6);
21 this.id = id;
22 this.font = font;
23 }
24
25 @Override
26 public boolean encode(Player player) {
27 builder.writeShort(id, ByteModification.ADD, ByteOrder.LE)
28 .writeInt(font);
29 return true;
30 }
31
32}
This class represents a character controlled by a player.
Definition Player.java:125
OutgoingPacket(int opcode, int capacity)
boolean encode(Player player)
Definition SendFont.java:26
Represents RuneScape's custom value types.
ADD
Adds 128 to the value when written, subtracts 128 from the rarity when read.
Represents the order in which bytes are written.
Definition ByteOrder.java:8
LE
Represents Little-endian.