From 866c376ee58692d7e726f5f5a53d767470219599 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Wed, 16 Apr 2025 10:20:10 +0200 Subject: [PATCH] Fix DevCommand not working when version switching without trying to connect in between when no server is running --- .../src/de/steamwar/velocitycore/commands/DevCommand.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/DevCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/DevCommand.java index 71b4427c..bf74e672 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/DevCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/DevCommand.java @@ -135,12 +135,12 @@ public class DevCommand extends SWCommand { }); devServerPorts.forEach((username, value) -> { - if (devServers.containsKey(username)) - return; - SteamwarUser user = SteamwarUser.get(username); String name = "Dev " + user.getUserName(); ((VelocityViaConfig) Via.getConfig()).getVelocityServerProtocols().put(name, ServerVersion.get(devServerVersions.get(username)).getProtocolVersion().getProtocol()); + + if (devServers.containsKey(username)) + return; devServers.put(user.getUserName().toLowerCase(), VelocityCore.getProxy().registerServer(new ServerInfo(name, new InetSocketAddress("127.0.0.1", value)))); }); }