From 2db2d0fcedfe7d885f182d12976fff183c17baf3 Mon Sep 17 00:00:00 2001 From: Darien Johnson <84008186+CADIndie@users.noreply.github.com> Date: Mon, 23 Sep 2024 02:10:12 -0500 Subject: [PATCH] Fix Helm URL --- src/main/java/pojlib/API.java | 3 ++- src/main/java/pojlib/account/MinecraftAccount.java | 14 +++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/pojlib/API.java b/src/main/java/pojlib/API.java index a45c3ba5..17776ee6 100644 --- a/src/main/java/pojlib/API.java +++ b/src/main/java/pojlib/API.java @@ -8,6 +8,7 @@ import com.google.gson.JsonObject; import pojlib.account.MinecraftAccount; +import pojlib.account.Msa; import pojlib.util.Logger; import pojlib.util.json.MinecraftInstances; import pojlib.util.Constants; @@ -212,7 +213,7 @@ public static void login(Activity activity) } MinecraftAccount acc = MinecraftAccount.load(activity.getFilesDir() + "/accounts"); - if(acc != null && (acc.expiresOn >= System.currentTimeMillis() || !hasWifi || acc.expiresOn == 0)) { + if(acc != null && (acc.expiresOn >= System.currentTimeMillis() || !hasWifi || !Msa.doesOwnGame)) { currentAcc = acc; API.profileImage = MinecraftAccount.getSkinFaceUrl(API.currentAcc); API.profileName = API.currentAcc.username; diff --git a/src/main/java/pojlib/account/MinecraftAccount.java b/src/main/java/pojlib/account/MinecraftAccount.java index a47632fd..40cac30b 100644 --- a/src/main/java/pojlib/account/MinecraftAccount.java +++ b/src/main/java/pojlib/account/MinecraftAccount.java @@ -45,11 +45,15 @@ public static MinecraftAccount load(String path) { } public static String getSkinFaceUrl(MinecraftAccount account) { - try { - return Constants.MINOTAR_URL + "/helm/" + account.uuid; - } catch (NullPointerException e) { - Logger.getInstance().appendToLog("Username likely not set! Please set your username at Minecraft.net and try again. | " + e); - return null; + if (!Msa.doesOwnGame) { + return Constants.MINOTAR_URL + "/helm/MHF_Steve"; + } else { + try { + return Constants.MINOTAR_URL + "/helm/" + account.uuid; + } catch (NullPointerException e) { + Logger.getInstance().appendToLog("Username likely not set! Please set your username at Minecraft.net and try again. | " + e); + return null; + } } } }