From bd54b343340c8095c9ffe8760c1a750bc543d063 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Mon, 15 May 2023 01:15:49 -0400 Subject: [PATCH] When pinging the server with protocol version -1, return the latest version supported by the proxy This matches BungeeCord's behavior and is in line with what clients specifying this meta-version would expect. --- .../proxy/connection/util/ServerListPingHandler.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/util/ServerListPingHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/util/ServerListPingHandler.java index 760ef2fea..d253d3594 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/util/ServerListPingHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/util/ServerListPingHandler.java @@ -47,6 +47,9 @@ public class ServerListPingHandler { } private ServerPing constructLocalPing(ProtocolVersion version) { + if (version == ProtocolVersion.UNKNOWN) { + version = ProtocolVersion.MAXIMUM_VERSION; + } VelocityConfiguration configuration = server.getConfiguration(); return new ServerPing( new ServerPing.Version(version.getProtocol(),