Skip to content

Commit

Permalink
Fix Helm URL
Browse files Browse the repository at this point in the history
  • Loading branch information
CADIndie committed Sep 23, 2024
1 parent 745c4dc commit 2db2d0f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/main/java/pojlib/API.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
14 changes: 9 additions & 5 deletions src/main/java/pojlib/account/MinecraftAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}

0 comments on commit 2db2d0f

Please sign in to comment.