[FEATURE] Support 1.20+ autoenter

This commit is contained in:
Gravita 2023-10-30 23:11:05 +07:00
parent 2792b5a008
commit fca2ed2447

View file

@ -112,8 +112,12 @@ private void addModernClientArgs(Collection<String> 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) {