RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
SendConfig.java
1
package
com.osroyale.net.packet.out;
2
3
import
com.osroyale.net.codec.ByteOrder;
4
import
com.osroyale.game.world.entity.mob.player.Player;
5
import
com.osroyale.net.packet.OutgoingPacket;
6
35
36
public
class
SendConfig
extends
OutgoingPacket {
37
38
private
final
int
id;
39
private
final
int
value;
40
private
final
boolean
intValue;
41
42
public
SendConfig(
int
id
,
int
value,
boolean
intValue) {
43
super(intValue ? 87 : 36, intValue ? 6 : 3);
44
this.id = id;
45
this.value = value;
46
this.intValue = intValue;
47
}
48
49
public
SendConfig(
int
id
,
int
value) {
50
this
(id, value, value < Byte.MIN_VALUE || value > Byte.MAX_VALUE);
51
}
52
53
@Override
54
public
boolean
encode(
Player
player) {
55
if
(value == -1) {
56
return
false
;
57
}
58
if
(intValue) {
59
builder.writeShort(
id
,
ByteOrder
.
LE
).writeInt(value,
ByteOrder
.
ME
);
60
}
else
{
61
builder.writeShort(
id
,
ByteOrder
.
LE
).writeByte(value);
62
}
63
64
return
true
;
65
}
66
67
}
com.osroyale.game.world.entity.mob.player.Player
Definition
Player.java:162
com.osroyale.net.codec.ByteOrder
Definition
ByteOrder.java:33
com.osroyale.net.codec.ByteOrder.LE
LE
Definition
ByteOrder.java:38
com.osroyale.net.codec.ByteOrder.ME
ME
Definition
ByteOrder.java:48