From 320d3ca8355f710734d218c1bbd335073e8a2175 Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Mon, 29 Aug 2011 14:58:42 +0100 Subject: Added method to retrieve all registered permissions --- src/main/java/org/bukkit/plugin/PluginManager.java | 9 +++++++++ src/main/java/org/bukkit/plugin/SimplePluginManager.java | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/main/java/org/bukkit/plugin/PluginManager.java b/src/main/java/org/bukkit/plugin/PluginManager.java index f2c407d3..d137c565 100644 --- a/src/main/java/org/bukkit/plugin/PluginManager.java +++ b/src/main/java/org/bukkit/plugin/PluginManager.java @@ -242,4 +242,13 @@ public interface PluginManager { * @return Set containing all subscribed permissions */ public Set getDefaultPermSubscriptions(boolean op); + + /** + * Gets a set of all registered permissions. + * + * This set is a copy and will not be modified live. + * + * @return Set containing all current registered permissions + */ + public Set getPermissions(); } diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java index 7f37d29e..1c25077a 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -537,4 +537,8 @@ public final class SimplePluginManager implements PluginManager { return ImmutableSet.copyOf(map.keySet()); } } + + public Set getPermissions() { + return new HashSet(permissions.values()); + } } -- cgit v1.2.3