From ddfbf4593d3cb50f6a3ce13b5a75cd2d03592e3b Mon Sep 17 00:00:00 2001 From: Agatha Lovelace Date: Fri, 8 Apr 2022 19:45:33 +0200 Subject: [PATCH] Disable auth in singleplayer --- .../samo_lego/simpleauth/mixin/MixinServerPlayerEntity.java | 4 +++- .../main/java/org/samo_lego/simpleauth/utils/PlayerAuth.java | 2 +- gradle.properties | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/org/samo_lego/simpleauth/mixin/MixinServerPlayerEntity.java b/common/src/main/java/org/samo_lego/simpleauth/mixin/MixinServerPlayerEntity.java index f9780d0..eb78ce3 100644 --- a/common/src/main/java/org/samo_lego/simpleauth/mixin/MixinServerPlayerEntity.java +++ b/common/src/main/java/org/samo_lego/simpleauth/mixin/MixinServerPlayerEntity.java @@ -161,7 +161,9 @@ public class MixinServerPlayerEntity implements PlayerAuth { */ @Override public boolean canSkipAuth() { - return PlatformSpecific.isPlayerFake(this.player) || (isUsingMojangAccount() && config.main.premiumAutologin); + return PlatformSpecific.isPlayerFake(this.player) || + this.player.server.isSingleplayer() || + (isUsingMojangAccount() && config.main.premiumAutologin); } /** diff --git a/common/src/main/java/org/samo_lego/simpleauth/utils/PlayerAuth.java b/common/src/main/java/org/samo_lego/simpleauth/utils/PlayerAuth.java index 35abc37..7e454bf 100644 --- a/common/src/main/java/org/samo_lego/simpleauth/utils/PlayerAuth.java +++ b/common/src/main/java/org/samo_lego/simpleauth/utils/PlayerAuth.java @@ -54,7 +54,7 @@ public interface PlayerAuth { /** * Checks whether player is a fake player (from CarpetMod). * - * @return true if player is fake (can skip authentication process), otherwise false + * @return true if player is fake or in singleplayer (can skip authentication process), otherwise false * @see See implementation */ boolean canSkipAuth(); diff --git a/gradle.properties b/gradle.properties index 531c26f..2658962 100644 --- a/gradle.properties +++ b/gradle.properties @@ -29,3 +29,5 @@ bytes_version = 1.3.0 # Carpet for debugging carpet_core_version = 1.4.69+v220331 carpet_branch = master + +org.gradle.jvmargs=-Xmx4G \ No newline at end of file