Skip to content

Commit

Permalink
Remove Useless Param
Browse files Browse the repository at this point in the history
  • Loading branch information
CADIndie committed Sep 23, 2024
1 parent 9125352 commit cc83f67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/pojlib/InstanceHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public static void launchInstance(Activity activity, MinecraftAccount account, M
API.currentInstance = instance;
JREUtils.redirectAndPrintJRELog();
VLoader.setAndroidInitInfo(activity);
JREUtils.launchJavaVM(activity, instance.generateLaunchArgs(account, !Msa.doesOwnGame), instance);
JREUtils.launchJavaVM(activity, instance.generateLaunchArgs(account), instance);
} catch (Throwable e) {
e.printStackTrace();
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/pojlib/util/json/MinecraftInstances.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import pojlib.account.MinecraftAccount;
import pojlib.API;
import pojlib.InstanceHandler;
import pojlib.account.Msa;
import pojlib.util.Constants;
import pojlib.util.DownloadUtils;
import pojlib.util.FileUtil;
Expand Down Expand Up @@ -50,15 +51,15 @@ public static class Instance {
public ProjectInfo[] extProjects;
public boolean defaultMods;

public List<String> generateLaunchArgs(MinecraftAccount account, boolean isDemoMode) {
public List<String> generateLaunchArgs(MinecraftAccount account) {
String[] mcArgs = {"--username", account.username, "--version", versionName, "--gameDir", gameDir,
"--assetsDir", assetsDir, "--assetIndex", assetIndex, "--uuid", account.uuid.replace("-", ""),
"--accessToken", account.accessToken, "--userType", account.userType, "--versionType", "release"};

List<String> allArgs = new ArrayList<>(Arrays.asList("-cp", classpath));
allArgs.add(mainClass);
allArgs.addAll(Arrays.asList(mcArgs));
if (isDemoMode) {allArgs.add("--demo");}
if (!Msa.doesOwnGame) {allArgs.add("--demo");}

return allArgs;
}
Expand Down

0 comments on commit cc83f67

Please sign in to comment.