diff --git a/src/main/java/net/azisaba/kuvel/config/KuvelConfig.java b/src/main/java/net/azisaba/kuvel/config/KuvelConfig.java index e6c528b0..21ca2978 100644 --- a/src/main/java/net/azisaba/kuvel/config/KuvelConfig.java +++ b/src/main/java/net/azisaba/kuvel/config/KuvelConfig.java @@ -23,6 +23,21 @@ public class KuvelConfig { @Nullable private String proxyGroupName; public void load() throws IOException { + File uppercaseDataFolder = new File(plugin.getDataDirectory().getParentFile(), "Kuvel"); + if (uppercaseDataFolder.exists() && !plugin.getDataDirectory().exists()) { + if (uppercaseDataFolder.renameTo(plugin.getDataDirectory())) { + plugin + .getLogger() + .info( + "Successfully renamed the data folder to use a lowercase name."); + } else { + plugin + .getLogger() + .warn( + "Failed to rename the data folder to be lowercase. Please manually rename the data folder to 'kuvel'."); + } + } + VelocityConfigLoader conf = VelocityConfigLoader.load(new File(plugin.getDataDirectory(), CONFIG_FILE_NAME)); conf.saveDefaultConfig();