diff --git a/launcher/minecraft/MinecraftInstance.cpp b/launcher/minecraft/MinecraftInstance.cpp index 2c624a365..caba8f9a7 100644 --- a/launcher/minecraft/MinecraftInstance.cpp +++ b/launcher/minecraft/MinecraftInstance.cpp @@ -564,8 +564,15 @@ QStringList MinecraftInstance::processMinecraftArgs( if (serverToJoin && !serverToJoin->address.isEmpty()) { - args_pattern += " --server " + serverToJoin->address; - args_pattern += " --port " + QString::number(serverToJoin->port); + if (profile->hasTrait("quickPlay")) + { + args_pattern += " --quickPlayMultiplayer " + serverToJoin->address + ':' + QString::number(serverToJoin->port); + } + else + { + args_pattern += " --server " + serverToJoin->address; + args_pattern += " --port " + QString::number(serverToJoin->port); + } } QMap token_mapping; diff --git a/libraries/launcher/org/prismlauncher/launcher/impl/StandardLauncher.java b/libraries/launcher/org/prismlauncher/launcher/impl/StandardLauncher.java index 9436ff15e..c9ec34909 100644 --- a/libraries/launcher/org/prismlauncher/launcher/impl/StandardLauncher.java +++ b/libraries/launcher/org/prismlauncher/launcher/impl/StandardLauncher.java @@ -55,14 +55,21 @@ package org.prismlauncher.launcher.impl; import java.lang.invoke.MethodHandle; +import java.util.Collections; +import java.util.List; import org.prismlauncher.utils.Parameters; import org.prismlauncher.utils.ReflectionUtils; public final class StandardLauncher extends AbstractLauncher { + private final boolean quickPlaySupported; + public StandardLauncher(Parameters params) { super(params); + + List traits = params.getList("traits", Collections.emptyList()); + quickPlaySupported = traits.contains("quickPlay"); } @Override @@ -77,10 +84,16 @@ public final class StandardLauncher extends AbstractLauncher { } if (serverAddress != null) { - gameArgs.add("--server"); - gameArgs.add(serverAddress); - gameArgs.add("--port"); - gameArgs.add(serverPort); + if (quickPlaySupported) { + // as of 23w14a + gameArgs.add("--quickPlayMultiplayer"); + gameArgs.add(serverAddress + ':' + serverPort); + } else { + gameArgs.add("--server"); + gameArgs.add(serverAddress); + gameArgs.add("--port"); + gameArgs.add(serverPort); + } } // find and invoke the main method