From 404796d4b25902bf5312202e2ecbb97729b4c480 Mon Sep 17 00:00:00 2001 From: TheKodeToad Date: Thu, 3 Nov 2022 17:33:21 +0000 Subject: [PATCH] Sorry for reverting a lot but copying a list just hurts me Signed-off-by: TheKodeToad --- .../launcher/impl/AbstractLauncher.java | 2 +- .../launcher/impl/StandardLauncher.java | 20 +++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/libraries/launcher/org/prismlauncher/launcher/impl/AbstractLauncher.java b/libraries/launcher/org/prismlauncher/launcher/impl/AbstractLauncher.java index 9eda8caf7..391f71a98 100644 --- a/libraries/launcher/org/prismlauncher/launcher/impl/AbstractLauncher.java +++ b/libraries/launcher/org/prismlauncher/launcher/impl/AbstractLauncher.java @@ -82,7 +82,7 @@ public abstract class AbstractLauncher implements Launcher { protected AbstractLauncher(Parameters params) { - this.mcParams = Collections.unmodifiableList(params.getList("param", new ArrayList())); + this.mcParams = params.getList("param", new ArrayList()); this.mainClassName = params.getString("mainClass", "net.minecraft.client.Minecraft"); this.serverAddress = params.getString("serverAddress", null); diff --git a/libraries/launcher/org/prismlauncher/launcher/impl/StandardLauncher.java b/libraries/launcher/org/prismlauncher/launcher/impl/StandardLauncher.java index e7b4599b5..8ecfffb4b 100644 --- a/libraries/launcher/org/prismlauncher/launcher/impl/StandardLauncher.java +++ b/libraries/launcher/org/prismlauncher/launcher/impl/StandardLauncher.java @@ -79,24 +79,22 @@ public final class StandardLauncher extends AbstractLauncher { // the following often breaks linux screen setups // mcparams.add("--fullscreen"); - List launchParameters = new ArrayList<>(this.mcParams); - if (!this.maximize) { - launchParameters.add("--width"); - launchParameters.add(Integer.toString(width)); - launchParameters.add("--height"); - launchParameters.add(Integer.toString(height)); + mcParams.add("--width"); + mcParams.add(Integer.toString(width)); + mcParams.add("--height"); + mcParams.add(Integer.toString(height)); } if (this.serverAddress != null) { - launchParameters.add("--server"); - launchParameters.add(serverAddress); - launchParameters.add("--port"); - launchParameters.add(serverPort); + mcParams.add("--server"); + mcParams.add(serverAddress); + mcParams.add("--port"); + mcParams.add(serverPort); } MethodHandle method = ReflectionUtils.findMainMethod(this.mainClassName); - method.invokeExact(launchParameters.toArray(new String[0])); + method.invokeExact(mcParams.toArray(new String[0])); } private static class StandardLauncherProvider implements LauncherProvider {