#3801: Add support for 1.21.5-pre2

This commit is contained in:
Outfluencer 2025-03-12 23:19:09 +01:00 committed by GitHub
parent 9476ffccdb
commit e3c7fd8cc5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 23 additions and 1 deletions

View File

@ -49,7 +49,7 @@ public class ProtocolConstants
public static final int MINECRAFT_1_21 = 767;
public static final int MINECRAFT_1_21_2 = 768;
public static final int MINECRAFT_1_21_4 = 769;
public static final int MINECRAFT_1_21_5 = 1073742062;
public static final int MINECRAFT_1_21_5 = 1073742064;
public static final List<String> SUPPORTED_VERSIONS;
public static final List<Integer> SUPPORTED_VERSION_IDS;

View File

@ -25,6 +25,7 @@ public class ClientChat extends DefinedPacket
private boolean signedPreview;
private ChatChain chain;
private SeenMessages seenMessages;
private byte checksum;
@Override
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
@ -57,6 +58,11 @@ public class ClientChat extends DefinedPacket
chain = new ChatChain();
chain.read( buf, direction, protocolVersion );
}
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_21_5 )
{
checksum = buf.readByte();
}
}
@Override
@ -87,6 +93,11 @@ public class ClientChat extends DefinedPacket
{
chain.write( buf, direction, protocolVersion );
}
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_21_5 )
{
buf.writeByte( checksum );
}
}
@Override

View File

@ -28,6 +28,7 @@ public class ClientCommand extends DefinedPacket
private boolean signedPreview;
private ChatChain chain;
private SeenMessages seenMessages;
private byte checksum;
@Override
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
@ -68,6 +69,11 @@ public class ClientCommand extends DefinedPacket
chain = new ChatChain();
chain.read( buf, direction, protocolVersion );
}
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_21_5 )
{
checksum = buf.readByte();
}
}
@Override
@ -101,6 +107,11 @@ public class ClientCommand extends DefinedPacket
{
chain.write( buf, direction, protocolVersion );
}
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_21_5 )
{
buf.writeByte( checksum );
}
}
@Override