Sorry for reverting a lot but copying a list just hurts me

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad 2022-11-03 17:33:21 +00:00
parent 5b9bfe8891
commit 404796d4b2
2 changed files with 10 additions and 12 deletions

View File

@ -82,7 +82,7 @@ public abstract class AbstractLauncher implements Launcher {
protected AbstractLauncher(Parameters params)
{
this.mcParams = Collections.unmodifiableList(params.getList("param", new ArrayList<String>()));
this.mcParams = params.getList("param", new ArrayList<String>());
this.mainClassName = params.getString("mainClass", "net.minecraft.client.Minecraft");
this.serverAddress = params.getString("serverAddress", null);

View File

@ -79,24 +79,22 @@ public final class StandardLauncher extends AbstractLauncher {
// the following often breaks linux screen setups
// mcparams.add("--fullscreen");
List<String> 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 {