RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
SendAddFriend.java
1package com.osroyale.net.packet.out;
2
3import com.osroyale.net.packet.OutgoingPacket;
4import com.osroyale.game.world.entity.mob.player.Player;
5
33
34public final class SendAddFriend extends OutgoingPacket {
35
36 private final long username;
37 private int world;
38 private boolean display;
39
40 public SendAddFriend(long username, int world, boolean display) {
41 super(50, 10);
42 this.username = username;
43 this.world = world;
44 this.display = display;
45 }
46
47 public SendAddFriend(long username, int world) {
48 this(username, world, true);
49 }
50
51 @Override
52 protected boolean encode(Player player) {
53 world = world != 0 ? world + 9 : world;
54 builder.writeLong(username);
55 builder.writeByte(world);
56 builder.writeByte(display ? 1 : 0);
57 return true;
58 }
59
60}