More system properties because yes!! 🎉

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad
2023-08-11 00:02:27 +01:00
parent 7c547f6452
commit e2d77f21ba
3 changed files with 24 additions and 4 deletions

View File

@ -105,11 +105,25 @@ public final class EntryPoint {
return ExitCode.ABORT;
}
// populate properties to provide mods with more info
String name = params.getString("instanceName", "");
String iconKey = params.getString("instanceIconKey", "default");
System.setProperty("org.prismlauncher.instance.name", name);
System.setProperty("org.prismlauncher.instance.icon.id", iconKey);
System.setProperty("org.prismlauncher.instance.icon.path", "icon.png");
// set multimc properties for compatibility
System.setProperty("multimc.instance.title", name);
System.setProperty("multimc.instance.icon", iconKey);
// launch the game
String launcherType = params.getString("launcher");
try {
Launcher launcher;
String type = params.getString("launcher");
switch (type) {
switch (launcherType) {
case "standard":
launcher = new StandardLauncher(params);
break;
@ -119,7 +133,7 @@ public final class EntryPoint {
break;
default:
throw new IllegalArgumentException("Invalid launcher type: " + type);
throw new IllegalArgumentException("Invalid launcher type: " + launcherType);
}
launcher.launch();