From 2e646d2809b3d6c94234cf78de328b7659c0223d Mon Sep 17 00:00:00 2001 From: Wesley Wolfe Date: Sun, 15 Apr 2012 13:24:38 -0500 Subject: [PATCH] Made permissions.yml registration easier; Addresses BUKKIT-1499 The permissions.yml now behaves similar to a plugin.yml --- src/main/java/org/bukkit/craftbukkit/CraftServer.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 8e6bdd4131..170e091143 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -579,13 +579,13 @@ public final class CraftServer implements Server { return; } - Set keys = perms.keySet(); + List permsList = Permission.loadPermissions(perms, "Permission node '%s' in " + file + " is invalid", Permission.DEFAULT_PERMISSION); - for (String name : keys) { + for (Permission perm : permsList) { try { - pluginManager.addPermission(Permission.loadPermission(name, perms.get(name))); - } catch (Throwable ex) { - Bukkit.getServer().getLogger().log(Level.SEVERE, "Permission node '" + name + "' in server config is invalid", ex); + pluginManager.addPermission(perm); + } catch (IllegalArgumentException ex) { + getLogger().log(Level.SEVERE, "Permission in " + file + " was already defined", ex); } } }