Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
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.ConfigurationLoader;
import com.velocitypowered.proxy.config.VelocityConfiguration;
import com.velocitypowered.proxy.connection.client.ConnectedPlayer;
import com.velocitypowered.proxy.connection.player.resourcepack.VelocityResourcePackInfo;
Expand Down Expand Up @@ -403,8 +404,7 @@ private void registerTranslations() {
@SuppressFBWarnings("DM_EXIT")
private void doStartupConfigLoad() {
try {
Path configPath = Path.of("velocity.toml");
configuration = VelocityConfiguration.read(configPath);
configuration = ConfigurationLoader.loadConfiguration();

if (!configuration.validate()) {
logger.error("Your configuration is invalid. Velocity will not start up until the errors "
Expand All @@ -415,7 +415,7 @@ private void doStartupConfigLoad() {

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.yaml. The server will shut down.", e);
LogManager.shutdown();
System.exit(1);
}
Expand Down Expand Up @@ -478,11 +478,10 @@ public boolean isShutdown() {
* 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.yaml}
*/
public boolean reloadConfiguration() throws IOException {
Path configPath = Path.of("velocity.toml");
VelocityConfiguration newConfiguration = VelocityConfiguration.read(configPath);
VelocityConfiguration newConfiguration = ConfigurationLoader.loadConfiguration();

if (!newConfiguration.validate()) {
return false;
Expand Down
Loading