Skip to content

Commit

Permalink
Revert "Implement Config System"
Browse files Browse the repository at this point in the history
This reverts commit ece0ce6.
  • Loading branch information
CADIndie committed Dec 18, 2024
1 parent d4621ad commit a0de377
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 46 deletions.
12 changes: 12 additions & 0 deletions src/main/java/pojlib/API.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@

import androidx.annotation.Nullable;

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;
import pojlib.account.LoginHelper;

import java.io.IOException;
import java.util.Date;

/**
* This class is the only class used by the launcher to communicate and talk to pojlib. This keeps pojlib and launcher separate.
Expand All @@ -24,17 +28,25 @@ public class API {

public static String msaMessage = "";
public static String model = "Quest";
private static boolean hasQueried = false;
private static JsonObject initialResponse;
public static boolean finishedDownloading = true;
public static boolean ignoreInstanceName;
public static boolean customRAMValue = false;
public static double downloadStatus = 0;
public static String currentDownload = "";
public static String profileImage;
public static String profileName;
public static String profileUUID;
public static String memoryValue = "1800";
public static boolean developerMods;
public static MinecraftAccount currentAcc;
public static boolean isDemoMode;
public static MinecraftInstances.Instance currentInstance;

public static boolean advancedDebugger;


/**
* Add a mod to an instance
*
Expand Down
39 changes: 0 additions & 39 deletions src/main/java/pojlib/util/ConfigUtil.java

This file was deleted.

1 change: 0 additions & 1 deletion src/main/java/pojlib/util/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ public class Constants {
public static String MINOTAR_URL = "https://minotar.net";

public static String USER_HOME = new File(Environment.getExternalStorageDirectory(),"Android/data/com.qcxr.qcxr/files").getAbsolutePath();
public static String CONFIG_PATH = USER_HOME + "/config.json";
}
7 changes: 3 additions & 4 deletions src/main/java/pojlib/util/JREUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,9 @@ public static int launchJavaVM(final Activity activity, final List<String> JVMAr

//Add automatically generated args

// TODO: Let user set Xmx AND Xms
if (ConfigUtil.config.setCustomRAM) {
userArgs.add("-Xms" + ConfigUtil.config.customRAMValue + "M");
userArgs.add("-Xmx" + ConfigUtil.config.customRAMValue + "M");
if (API.customRAMValue) {
userArgs.add("-Xms" + API.memoryValue + "M");
userArgs.add("-Xmx" + API.memoryValue + "M");
} else {
if (API.model.equals("Meta Quest Pro") || API.model.equals("Oculus Headset1")) {
userArgs.add("-Xms" + 2048 + "M");
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/pojlib/util/json/MinecraftInstances.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import pojlib.account.MinecraftAccount;
import pojlib.API;
import pojlib.InstanceHandler;
import pojlib.util.ConfigUtil;
import pojlib.util.Constants;
import pojlib.util.download.DownloadManager;
import pojlib.util.download.DownloadUtils;
Expand Down Expand Up @@ -78,7 +77,7 @@ private ModsJson parseModsJson(String jsonPath) {

private ModsJson downloadCurrentModsJson(String userHome) throws Exception {
File mods = new File(userHome + "/new_mods.json");
if(ConfigUtil.config.setDevMods) {
if(API.developerMods) {
DownloadUtils.downloadFile(InstanceHandler.DEV_MODS, mods, new DownloadManager(1));
} else {
DownloadUtils.downloadFile(InstanceHandler.MODS, mods, new DownloadManager(1));
Expand Down

0 comments on commit a0de377

Please sign in to comment.