Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -402,8 +403,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 @@ -414,7 +414,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 @@ -477,11 +477,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