Disguise config now informs if it doesn't/does need update

This commit is contained in:
libraryaddict 2020-05-10 16:34:53 +12:00
parent e6b7651571
commit 66a66b3638
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4

View File

@ -491,6 +491,7 @@ public class DisguiseConfig {
} }
public static void saveDefaultConfig() { public static void saveDefaultConfig() {
DisguiseUtilities.getLogger().info("Config is out of date! Now updating it!");
String[] string = ReflectionManager.getResourceAsString(LibsDisguises.getInstance().getFile(), "config.yml") String[] string = ReflectionManager.getResourceAsString(LibsDisguises.getInstance().getFile(), "config.yml")
.split("\n"); .split("\n");
FileConfiguration savedConfig = LibsDisguises.getInstance().getConfig(); FileConfiguration savedConfig = LibsDisguises.getInstance().getConfig();
@ -781,7 +782,7 @@ public class DisguiseConfig {
} }
if (missingConfigs > 0) { if (missingConfigs > 0) {
if (config.getBoolean("UpdateConfig")) { if (config.getBoolean("UpdateConfig", true)) {
saveDefaultConfig(); saveDefaultConfig();
DisguiseUtilities.getLogger().info("Config has been auto-updated!"); DisguiseUtilities.getLogger().info("Config has been auto-updated!");
} else if (!verbose) { } else if (!verbose) {
@ -790,6 +791,8 @@ public class DisguiseConfig {
DisguiseUtilities.getLogger() DisguiseUtilities.getLogger()
.info("You can also add the missing entries yourself! Try '/libsdisguises config'"); .info("You can also add the missing entries yourself! Try '/libsdisguises config'");
} }
} else {
DisguiseUtilities.getLogger().info("Config is up to date!");
} }
} }