From 8e13402112e7ee41f09883aec8b2b03246929fdf Mon Sep 17 00:00:00 2001 From: Darien Johnson <84008186+CADIndie@users.noreply.github.com> Date: Thu, 4 Apr 2024 22:16:30 -0400 Subject: [PATCH] Fix RAM check --- src/main/java/pojlib/util/JREUtils.java | 2 +- src/main/java/pojlib/util/LoginHelper.java | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/pojlib/util/JREUtils.java b/src/main/java/pojlib/util/JREUtils.java index dfe69ce8..ac2ae201 100644 --- a/src/main/java/pojlib/util/JREUtils.java +++ b/src/main/java/pojlib/util/JREUtils.java @@ -184,7 +184,7 @@ public static int launchJavaVM(final Activity activity, final List JVMAr userArgs.add("-Xms" + API_V1.memoryValue + "M"); userArgs.add("-Xmx" + API_V1.memoryValue + "M"); } else { - if (API_V1.model.equals("Oculus Headset1")) { + if (API_V1.model.equals("Meta Quest Pro")) { userArgs.add("-Xms" + 4096 + "M"); userArgs.add("-Xmx" + 4096 + "M"); } else { diff --git a/src/main/java/pojlib/util/LoginHelper.java b/src/main/java/pojlib/util/LoginHelper.java index 5acaa125..64a003eb 100644 --- a/src/main/java/pojlib/util/LoginHelper.java +++ b/src/main/java/pojlib/util/LoginHelper.java @@ -58,13 +58,14 @@ public static MinecraftAccount getNewToken(Activity activity) { try { Set accounts = pca.getAccounts().join(); if (accounts.isEmpty()) { - System.out.println("Error!: QuestCraft account not set!"); + Logger.getInstance().appendToLog("Error!: QuestCraft account not set!"); beginLogin(activity); - return null; + throw new RuntimeException("Error!: QuestCraft account not set!"); } IAccount account = accounts.iterator().next(); future = pca.acquireTokenSilently(SilentParameters.builder(Set.of("XboxLive.SignIn", "XboxLive.offline_access"), account).build()); } catch (MalformedURLException e) { + Logger.getInstance().appendToLog(e.getMessage()); throw new RuntimeException(e); } @@ -72,8 +73,8 @@ public static MinecraftAccount getNewToken(Activity activity) { IAuthenticationResult res = future.get(); return MinecraftAccount.load(activity.getFilesDir() + "/accounts", res.accessToken(), String.valueOf(res.expiresOnDate().getTime())); } catch (ExecutionException | InterruptedException e) { - Thread.currentThread().interrupt(); - return null; + Logger.getInstance().appendToLog(e.getMessage()); + throw new RuntimeException(e); } }