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

@ -14,6 +14,9 @@ package fr.neatmonster.nocheatplus.config;
*/
public abstract class ConfPaths {
// General:
public static final String SAVEBACKCONFIG = "savebackconfig";
/*
* 888 ,e,
* 888 e88 88e e88 888 e88 888 " 888 8e e88 888

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

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