mirror of
https://github.com/Nan1t/NanoLimbo.git
synced 2025-07-13 13:10:13 +02:00
Rewrite KeepAlive for supported versions
This commit is contained in:
parent
e931773ce8
commit
315b47ca7b
@ -18,12 +18,20 @@ public class PacketKeepAlive implements Packet {
|
||||
|
||||
@Override
|
||||
public void encode(ByteMessage msg, Version version) {
|
||||
msg.writeLong(id);
|
||||
if (version.moreOrEqual(Version.V1_12_2)) {
|
||||
msg.writeLong(id);
|
||||
} else {
|
||||
msg.writeVarInt((int) id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decode(ByteMessage msg, Version version) {
|
||||
this.id = msg.readLong();
|
||||
if (version.moreOrEqual(Version.V1_12_2)) {
|
||||
this.id = msg.readLong();
|
||||
} else {
|
||||
this.id = msg.readVarInt();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user