RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
SendString.java
1package com.osroyale.net.packet.out;
2
3import com.osroyale.game.world.entity.mob.player.Player;
4import com.osroyale.net.codec.ByteModification;
5import com.osroyale.net.packet.OutgoingPacket;
6import com.osroyale.net.packet.PacketType;
7
38
39public class SendString extends OutgoingPacket {
40
41 private final Object string;
42 private final int id;
43 private final boolean override;
44
45 public SendString(Object string, int id, boolean override) {
46 super(126, PacketType.VAR_SHORT);
47 this.string = string;
48 this.id = id;
49 this.override = override;
50 }
51
52 public SendString(Object string, int id) {
53 this(string, id, false);
54 }
55
56 @Override
57 public boolean encode(Player player) {
58 if (!override) {
59 if (id != 0 && !player.playerAssistant.checkSendString(String.valueOf(string), id)) {
60 return false;
61 }
62 }
63 builder.writeString(String.valueOf(string)).writeInt(id);
64 return true;
65 }
66
67}