RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
SendMarquee.java
1package com.osroyale.net.packet.out;
2
3import com.osroyale.game.world.World;
4import com.osroyale.game.world.entity.mob.player.Player;
5import com.osroyale.net.packet.OutgoingPacket;
6import com.osroyale.net.packet.PacketType;
7
29
30public class SendMarquee extends OutgoingPacket {
31
32 private final String[] strings;
33 private final int id;
34
35 public SendMarquee(int id, String... strings) {
36 super(205, PacketType.VAR_SHORT);
37 this.strings = strings;
38 this.id = id;
39 }
40
41 @Override
42 public boolean encode(Player player) {
43 builder.writeInt(id);
44 for (int index = 0; index < 5; index++) {
45 builder.writeString(index >= strings.length
46 ? ""
47 : strings[index].replace("#players", World.getPlayerCount() + ""));
48 }
49 return true;
50 }
51}