NOISSUE Add support for joining servers via Quick Play

This commit is contained in:
arthomnix
2023-04-08 10:29:12 +01:00
parent c1ed09e747
commit 22f82c34bf
4 changed files with 33 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
/* Copyright 2012-2021 MultiMC Contributors
/* Copyright 2012-2023 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -53,6 +53,7 @@ public class OneSixLauncher implements Launcher
private String serverAddress;
private String serverPort;
private boolean useQuickPlay;
// the much abused system classloader, for convenience (for further abuse)
private ClassLoader cl;
@@ -80,6 +81,7 @@ public class OneSixLauncher implements Launcher
serverAddress = params.firstSafe("serverAddress", null);
serverPort = params.firstSafe("serverPort", null);
useQuickPlay = params.firstSafe("useQuickPlay").startsWith("1");
cwd = System.getProperty("user.dir");
@@ -185,10 +187,18 @@ public class OneSixLauncher implements Launcher
if (serverAddress != null)
{
mcparams.add("--server");
mcparams.add(serverAddress);
mcparams.add("--port");
mcparams.add(serverPort);
if (useQuickPlay)
{
mcparams.add("--quickPlayMultiplayer");
mcparams.add(serverAddress + ":" + serverPort);
}
else
{
mcparams.add("--server");
mcparams.add(serverAddress);
mcparams.add("--port");
mcparams.add(serverPort);
}
}
// Get the Minecraft Class.