Skip to content

Commit

Permalink
Fix crash issue on 1.13-1.13.2
Browse files Browse the repository at this point in the history
(Backported minor changes from 3.0.0)
  • Loading branch information
jonesdevelopment committed Dec 1, 2024
1 parent de67ab1 commit 3d96a32
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ public void encode(final @NotNull ByteBuf byteBuf, final @NotNull ProtocolVersio
if (protocolVersion.lessThan(ProtocolVersion.MINECRAFT_1_8)) {
byteBuf.writeInt(0);
byteBuf.writeBytes(new byte[2]);
} else if (protocolVersion.lessThan(ProtocolVersion.MINECRAFT_1_15)) {
} else if (protocolVersion.lessThan(ProtocolVersion.MINECRAFT_1_13)) {
ProtocolUtil.writeVarInt(byteBuf, 0);
} else if (protocolVersion.lessThan(ProtocolVersion.MINECRAFT_1_18)) {
} else if (protocolVersion.lessThan(ProtocolVersion.MINECRAFT_1_15)) {
ProtocolUtil.writeByteArray(byteBuf, new byte[256 * 4]);
} else if (protocolVersion.lessThan(ProtocolVersion.MINECRAFT_1_18)) {
ProtocolUtil.writeVarInt(byteBuf, 0);
} else {
final byte[] sectionData = new byte[]{0, 0, 0, 0, 0, 0, 1, 0};
int count = protocolVersion.greaterThanOrEquals(ProtocolVersion.MINECRAFT_1_21_2) ? 24 : 16;
Expand Down

0 comments on commit 3d96a32

Please sign in to comment.