Basic Quick Play support
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
parent
3dccc38f42
commit
aaab95ba55
@ -563,10 +563,17 @@ QStringList MinecraftInstance::processMinecraftArgs(
|
||||
}
|
||||
|
||||
if (serverToJoin && !serverToJoin->address.isEmpty())
|
||||
{
|
||||
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;
|
||||
// yggdrasil!
|
||||
|
@ -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,11 +84,17 @@ public final class StandardLauncher extends AbstractLauncher {
|
||||
}
|
||||
|
||||
if (serverAddress != null) {
|
||||
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
|
||||
MethodHandle method = ReflectionUtils.findMainMethod(mainClassName);
|
||||
|
Loading…
Reference in New Issue
Block a user