From cf4580f1592c5f155d06236641f5875755d0e4fc Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Wed, 17 Jun 2026 21:31:32 +0100 Subject: [PATCH] feat(config): load velocity.yml at startup and reload Route VelocityServer's startup and reload paths through ConfigurationLoader.loadConfiguration(), so the proxy now reads velocity.yml (migrating an existing velocity.toml on first start) instead of reading velocity.toml directly. LegacyConfigurationLoader is retained behind the migration path. Co-Authored-By: Claude Opus 4.8 --- .../com/velocitypowered/proxy/VelocityServer.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java index 19c81595b..5bfac2d26 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java @@ -46,7 +46,7 @@ import com.velocitypowered.proxy.command.builtin.SendCommand; import com.velocitypowered.proxy.command.builtin.ServerCommand; import com.velocitypowered.proxy.command.builtin.ShutdownCommand; import com.velocitypowered.proxy.command.builtin.VelocityCommand; -import com.velocitypowered.proxy.config.LegacyConfigurationLoader; +import com.velocitypowered.proxy.config.ConfigurationLoader; import com.velocitypowered.proxy.config.VelocityConfiguration; import com.velocitypowered.proxy.connection.client.ConnectedPlayer; import com.velocitypowered.proxy.connection.player.resourcepack.VelocityResourcePackInfo; @@ -403,8 +403,7 @@ public class VelocityServer implements ProxyServer, ForwardingAudience { @SuppressFBWarnings("DM_EXIT") private void doStartupConfigLoad() { try { - Path configPath = Path.of("velocity.toml"); - configuration = LegacyConfigurationLoader.read(configPath); + configuration = ConfigurationLoader.loadConfiguration(); if (!configuration.validate()) { logger.error("Your configuration is invalid. Velocity will not start up until the errors " @@ -415,7 +414,7 @@ public class VelocityServer implements ProxyServer, ForwardingAudience { commandManager.setAnnounceProxyCommands(configuration.isAnnounceProxyCommands()); } catch (Exception e) { - logger.error("Unable to read/load/save your velocity.toml. The server will shut down.", e); + logger.error("Unable to read/load/save your velocity.yml. The server will shut down.", e); LogManager.shutdown(); System.exit(1); } @@ -478,11 +477,10 @@ public class VelocityServer implements ProxyServer, ForwardingAudience { * Reloads the proxy's configuration. * * @return {@code true} if successful, {@code false} if we can't read the configuration - * @throws IOException if we can't read {@code velocity.toml} + * @throws IOException if we can't read {@code velocity.yml} */ public boolean reloadConfiguration() throws IOException { - Path configPath = Path.of("velocity.toml"); - VelocityConfiguration newConfiguration = LegacyConfigurationLoader.read(configPath); + VelocityConfiguration newConfiguration = ConfigurationLoader.loadConfiguration(); if (!newConfiguration.validate()) { return false;