Expert setting: savebackconfig

This commit is contained in:
asofold 2012-09-22 00:59:38 +02:00
parent 9b1d2c617a
commit 0a2091ea54
3 changed files with 9 additions and 2 deletions

View File

@ -13,6 +13,9 @@ package fr.neatmonster.nocheatplus.config;
* Paths for the configuration options. Making everything final static prevents accidentally modifying any of these.
*/
public abstract class ConfPaths {
// General:
public static final String SAVEBACKCONFIG = "savebackconfig";
/*
* 888 ,e,

View File

@ -169,7 +169,7 @@ public class ConfigManager {
globalConfig.load(globalFile);
// Quick shallow ugly fix: only save back if loading was successful.
try {
globalConfig.save(globalFile);
if (globalConfig.getBoolean(ConfPaths.SAVEBACKCONFIG)) globalConfig.save(globalFile);
} catch (final Exception e) {
Bukkit.getLogger().severe("[NoCheatPlus] Could not save back config.yml (see exception below).");
e.printStackTrace();
@ -242,7 +242,7 @@ public class ConfigManager {
worldConfig.load(worldFile);
worldsMap.put(worldEntry.getKey(), worldConfig);
try{
worldConfig.save(worldFile);
if (worldConfig.getBoolean(ConfPaths.SAVEBACKCONFIG)) worldConfig.save(worldFile);
} catch (final Exception e){
Bukkit.getLogger().severe("[NoCheatPlus] Couldn't save back world-specific configuration for "
+ worldEntry.getKey() + " (see exception below).");

View File

@ -25,6 +25,10 @@ public class DefaultConfig extends ConfigFile {
*/
public DefaultConfig() {
super();
// General:
set(ConfPaths.SAVEBACKCONFIG, true);
/*
* 888 ,e,