Catch the error when using an out of date config for

'allow_commandblocks' So it doesn't kill the whole config.
This commit is contained in:
ElgarL 2013-02-15 17:39:34 +00:00
parent 33382f9940
commit 3740f200f8
2 changed files with 8 additions and 1 deletions

View File

@ -213,3 +213,4 @@ v 2.0:
- Prevent '*' permissions granting the 'groupmanager.noofflineperms' permission.
- Added '/mancheckw <world>' to inspect which permission files a world is referencing.
- Add config potion to set if GM commands should be allowed on CommnandBlocks.
- Catch the error when using an out of date config for 'allow_commandblocks' So it doesn't kill the whole config.

View File

@ -85,7 +85,13 @@ public class GMConfiguration {
try {
Map<String, Object> config = getElement("config", getElement("settings", GMconfig));
allowCommandBlocks = (Boolean) config.get("allow_commandblocks");
try {
allowCommandBlocks = (Boolean) config.get("allow_commandblocks");
} catch (Exception ex) {
GroupManager.logger.log(Level.SEVERE, "Missing or corrupt 'allow_commandblocks' node. Using default settings", ex);
}
opOverride = (Boolean) config.get("opOverrides");
toggleValidate = (Boolean) config.get("validate_toggle");