diff --git a/src/main/java/com/loganmagnan/pluginbase/PluginBase.java b/src/main/java/com/loganmagnan/pluginbase/PluginBase.java index dc5f300..49075ff 100644 --- a/src/main/java/com/loganmagnan/pluginbase/PluginBase.java +++ b/src/main/java/com/loganmagnan/pluginbase/PluginBase.java @@ -40,8 +40,8 @@ public class PluginBase extends JavaPlugin { // Initialize all of the configuration files this.saveDefaultConfig(); - this.mainConfig = new Config("config", this); - this.messagesConfig = new FileConfig(this, "messages.yml"); + this.mainConfig = new Config("config", this, true); + this.messagesConfig = new FileConfig(this, "messages.yml", true); // Say the plugin's name this.getServer().getConsoleSender().sendMessage(Utils.chatBar); diff --git a/src/main/java/com/loganmagnan/pluginbase/utils/config/FileConfig.java b/src/main/java/com/loganmagnan/pluginbase/utils/config/FileConfig.java index be0f9ff..aaac4da 100644 --- a/src/main/java/com/loganmagnan/pluginbase/utils/config/FileConfig.java +++ b/src/main/java/com/loganmagnan/pluginbase/utils/config/FileConfig.java @@ -24,7 +24,7 @@ public class FileConfig { return this.config; } - public FileConfig(JavaPlugin plugin, String fileName) { + public FileConfig(JavaPlugin plugin, String fileName, boolean update) { this.file = new File(plugin.getDataFolder(), fileName); if (!this.file.exists()) { this.file.getParentFile().mkdirs(); @@ -40,7 +40,9 @@ public class FileConfig { } try { - ConfigUpdater.update(PluginBase.getInstance(), fileName, this.file); + if (update) { + ConfigUpdater.update(PluginBase.getInstance(), fileName, this.file); + } } catch (Exception exception) { exception.printStackTrace(); } diff --git a/src/main/java/com/loganmagnan/pluginbase/utils/config/file/Config.java b/src/main/java/com/loganmagnan/pluginbase/utils/config/file/Config.java index 586c991..afa6a19 100644 --- a/src/main/java/com/loganmagnan/pluginbase/utils/config/file/Config.java +++ b/src/main/java/com/loganmagnan/pluginbase/utils/config/file/Config.java @@ -17,7 +17,7 @@ public class Config { private final File configFile; protected boolean wasCreated; - public Config(String name, JavaPlugin plugin) { + public Config(String name, JavaPlugin plugin, boolean update) { this.configFile = new File(plugin.getDataFolder() + "/" + name + ".yml"); if (!this.configFile.exists()) { try { @@ -30,7 +30,9 @@ public class Config { } try { - ConfigUpdater.update(PluginBase.getInstance(), name + ".yml", this.configFile); + if (update) { + ConfigUpdater.update(PluginBase.getInstance(), name + ".yml", this.configFile); + } } catch (Exception exception) { exception.printStackTrace(); }