RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
SendScreenFade.java
1package com.osroyale.net.packet.out;
2
3import com.osroyale.game.world.entity.mob.player.Player;
4import com.osroyale.net.packet.OutgoingPacket;
5import com.osroyale.net.packet.PacketType;
6
36
37public class SendScreenFade extends OutgoingPacket {
38
39 private final String text;
40 private final int state;
41 private final int seconds;
42
43 public SendScreenFade(String text, int state, int seconds) {
44 super(9, PacketType.VAR_BYTE);
45 this.text = text;
46 this.state = state;
47 this.seconds = seconds;
48
49 if (seconds < 1) {
50 throw new IllegalArgumentException("The amount of seconds cannot be less than one.");
51 }
52 }
53
54 @Override
55 protected boolean encode(Player player) {
56 builder.writeString(text);
57 builder.writeByte(state);
58 builder.writeByte(seconds);
59 return true;
60 }
61}