From 63b2c67fbdb1902e770028b99dd288e89ef40ac1 Mon Sep 17 00:00:00 2001 From: RaphiMC <50594595+RaphiMC@users.noreply.github.com> Date: Sun, 12 Jan 2025 20:47:32 +0100 Subject: [PATCH] Added short form for Auto Detect protocol name --- .../java/net/raphimc/viaproxy/util/ProtocolVersionUtil.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/net/raphimc/viaproxy/util/ProtocolVersionUtil.java b/src/main/java/net/raphimc/viaproxy/util/ProtocolVersionUtil.java index fd5de637..f0c0679f 100644 --- a/src/main/java/net/raphimc/viaproxy/util/ProtocolVersionUtil.java +++ b/src/main/java/net/raphimc/viaproxy/util/ProtocolVersionUtil.java @@ -18,10 +18,15 @@ package net.raphimc.viaproxy.util; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; +import net.raphimc.viaproxy.protocoltranslator.ProtocolTranslator; public class ProtocolVersionUtil { public static ProtocolVersion fromNameLenient(final String name) { + if (name.equalsIgnoreCase("auto")) { // Short form for auto-detect + return ProtocolTranslator.AUTO_DETECT_PROTOCOL; + } + final ProtocolVersion version = ProtocolVersion.getClosest(name); if (version == null) { return ProtocolVersion.getClosest(name.replace("-", " "));