mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-02-01 12:21:23 +01:00
Expert setting: savebackconfig
This commit is contained in:
parent
9b1d2c617a
commit
0a2091ea54
@ -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
|
||||
|
@ -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).");
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user