From 71bb0246a8bf7507b570e6a82a99ce77a33ad19d Mon Sep 17 00:00:00 2001 From: "Pantera (Mad_Daniel)" <89838384+Pantera07@users.noreply.github.com> Date: Fri, 24 May 2024 03:12:28 +0900 Subject: [PATCH] Fix query listener reload bug (#1322) --- .../main/java/com/velocitypowered/proxy/VelocityServer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java index 1a9d71cb41..ef8217c696 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java @@ -469,11 +469,11 @@ public boolean reloadConfiguration() throws IOException { boolean queryPortChanged = newConfiguration.getQueryPort() != configuration.getQueryPort(); boolean queryAlreadyEnabled = configuration.isQueryEnabled(); boolean queryEnabled = newConfiguration.isQueryEnabled(); - if ((!queryEnabled && queryAlreadyEnabled) || queryPortChanged) { + if (queryAlreadyEnabled && (!queryEnabled || queryPortChanged)) { this.cm.close(new InetSocketAddress( configuration.getBind().getHostString(), configuration.getQueryPort())); } - if (queryEnabled && queryPortChanged) { + if (queryEnabled && (!queryAlreadyEnabled || queryPortChanged)) { this.cm.queryBind(newConfiguration.getBind().getHostString(), newConfiguration.getQueryPort()); }