Catch all errors in badly formatted groups.

This commit is contained in:
ElgarL 2012-01-31 03:16:34 +00:00
parent fe050dd725
commit 3f02bcd702
3 changed files with 9 additions and 7 deletions

View File

@ -16,7 +16,7 @@
<arguments> <arguments>
<dictionary> <dictionary>
<key>LaunchConfigHandle</key> <key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/New_Builder.launch</value> <value>&lt;project&gt;/.externalToolBuilders/GroupManager.launch</value>
</dictionary> </dictionary>
</arguments> </arguments>
</buildCommand> </buildCommand>

View File

@ -133,3 +133,4 @@ v 1.9:
- -vanish.* - -vanish.*
- vanish.standard - vanish.standard
- Track the 'onPlayerChangeWorld' event as some teleports seem to not be triggering a world move. - Track the 'onPlayerChangeWorld' event as some teleports seem to not be triggering a world move.
- Catch all errors in badly formatted groups.

View File

@ -445,7 +445,7 @@ public class WorldDataHolder {
//PROCESS GROUPS FILE //PROCESS GROUPS FILE
Map<String, List<String>> inheritance = new HashMap<String, List<String>>(); Map<String, List<String>> inheritance = new HashMap<String, List<String>>();
//try { try {
Map<String, Object> allGroupsNode = (Map<String, Object>) groupsRootDataNode.get("groups"); Map<String, Object> allGroupsNode = (Map<String, Object>) groupsRootDataNode.get("groups");
for (String groupKey : allGroupsNode.keySet()) { for (String groupKey : allGroupsNode.keySet()) {
Map<String, Object> thisGroupNode = (Map<String, Object>) allGroupsNode.get(groupKey); Map<String, Object> thisGroupNode = (Map<String, Object>) allGroupsNode.get(groupKey);
@ -514,10 +514,11 @@ public class WorldDataHolder {
}else }else
throw new IllegalArgumentException("Unknown entry found in inheritance section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); throw new IllegalArgumentException("Unknown entry found in inheritance section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath());
} }
//} catch (Exception ex) { } catch (Exception ex) {
// ex.printStackTrace(); ex.printStackTrace();
// throw new IllegalArgumentException("Your Permissions config file is invalid. See console for details."); throw new IllegalArgumentException("Your " + groupsFile.getPath() + " file is invalid. See console for details.");
//} }
if (ph.getDefaultGroup() == null) { if (ph.getDefaultGroup() == null) {
throw new IllegalArgumentException("There was no Default Group declared in file: " + groupsFile.getPath()); throw new IllegalArgumentException("There was no Default Group declared in file: " + groupsFile.getPath());
} }