Strip removed config options, add DisableSaving and bump config version
This commit is contained in:
@@ -12,7 +12,7 @@ import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
public class ConfigUpdater {
|
||||
|
||||
private static final int CONFIG_VERSION = 2;
|
||||
private static final int CONFIG_VERSION = 3;
|
||||
|
||||
private final OpenInv plugin;
|
||||
|
||||
@@ -41,10 +41,22 @@ public class ConfigUpdater {
|
||||
switch (getConfigVersion()) {
|
||||
case 1:
|
||||
updateConfig1To2();
|
||||
case 2:
|
||||
updateConfig2To3();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void updateConfig2To3() {
|
||||
plugin.getConfig().set("config-version", 3);
|
||||
plugin.getConfig().set("items.open-inv", null);
|
||||
plugin.getConfig().set("toggles.items.open-inv", null);
|
||||
plugin.getConfig().set("settings.disable-saving", plugin.getConfig().getBoolean("DisableSaving", false));
|
||||
plugin.getConfig().set("DisableSaving", null);
|
||||
// Save the new config
|
||||
plugin.saveConfig();
|
||||
}
|
||||
|
||||
private void updateConfig1To2() {
|
||||
// Backup the old config file
|
||||
try {
|
||||
|
@@ -225,7 +225,7 @@ public class OpenInv extends JavaPlugin {
|
||||
* @return false unless configured otherwise
|
||||
*/
|
||||
public boolean disableSaving() {
|
||||
return getConfig().getBoolean("DisableSaving", false);
|
||||
return getConfig().getBoolean("settings.disable-saving", false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user