Basic Quick Play support
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
parent
3dccc38f42
commit
aaab95ba55
@ -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<QString, QString> token_mapping;
|
||||
|
@ -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<String> traits = params.getList("traits", Collections.<String>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
|
||||
|
Loading…
Reference in New Issue
Block a user