Handle 1.20.5 login hello authenticate flag

This commit is contained in:
RaphiMC 2024-09-09 19:26:33 +02:00
parent 5ad8268f9b
commit e690a1eb10
No known key found for this signature in database
GPG key ID: 0F6BB0657A03AC94

View file

@ -148,8 +148,8 @@ public class LoginPacketHandler extends PacketHandler {
final SecretKey secretKey = CryptUtil.generateSecretKey();
final String serverHash = new BigInteger(CryptUtil.computeServerIdHash(loginHelloPacket.serverId, publicKey, secretKey)).toString(16);
boolean auth = true;
if (this.proxyConnection.getServerVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
boolean auth = !(packet instanceof S2CLoginHelloPacket1_20_5 packet1_20_5) || packet1_20_5.authenticate;
if (auth && this.proxyConnection.getServerVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
auth = this.proxyConnection.getUserConnection().get(ProtocolMetadataStorage.class).authenticate;
}
if (auth) {