Fixed authentication not working sometimes in <= 1.6.4

This commit is contained in:
FlorianMichael 2023-04-16 21:20:34 +02:00
parent 12f48411c8
commit b6124e4710
2 changed files with 2 additions and 2 deletions

View File

@ -78,7 +78,7 @@ public abstract class MixinClientConnection extends SimpleChannelInboundHandler<
@Inject(method = "setupEncryption", at = @At("HEAD"), cancellable = true)
private void storeEncryptionCiphers(Cipher decryptionCipher, Cipher encryptionCipher, CallbackInfo ci) {
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
if (ProtocolHack.getTargetVersion(channel).isOlderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
ci.cancel();
this.viafabricplus_decryptionCipher = decryptionCipher;
this.viafabricplus_encryptionCipher = encryptionCipher;

View File

@ -39,7 +39,7 @@ public class MixinClientLoginNetworkHandler {
@Inject(method = "joinServerSession", at = @At("HEAD"), cancellable = true)
public void dontVerifySessionIfCracked(String serverId, CallbackInfoReturnable<Text> cir) {
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
if (ProtocolHack.getTargetVersion(connection.channel).isOlderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) {
if (!connection.channel.attr(ProtocolHack.LOCAL_VIA_CONNECTION).get().get(ProtocolMetadataStorage.class).authenticate) {
cir.setReturnValue(null);
}