From fca2ed244740a741180d0e82c2dcf89691966c28 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Mon, 30 Oct 2023 23:11:05 +0700 Subject: [PATCH] [FEATURE] Support 1.20+ autoenter --- .../java/pro/gravit/launcher/client/ClientParams.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientParams.java b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientParams.java index 6a62179c..d464dfba 100644 --- a/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientParams.java +++ b/LauncherClient/src/main/java/pro/gravit/launcher/client/ClientParams.java @@ -112,8 +112,12 @@ private void addModernClientArgs(Collection args) { // Add server args if (autoEnter) { - Collections.addAll(args, "--server", profile.getServerAddress()); - Collections.addAll(args, "--port", Integer.toString(profile.getServerPort())); + if (version.compareTo(ClientProfileVersions.MINECRAFT_1_20) <= 0) { + Collections.addAll(args, "--server", profile.getServerAddress()); + Collections.addAll(args, "--port", Integer.toString(profile.getServerPort())); + } else { + Collections.addAll(args, "--quickPlayMultiplayer", String.format("%s:%d", profile.getServerAddress(), profile.getServerPort())); + } } for (OptionalAction a : actions) { if (a instanceof OptionalActionClientArgs) {