diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-08-29 14:58:42 +0100 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-08-29 14:58:42 +0100 |
commit | 320d3ca8355f710734d218c1bbd335073e8a2175 (patch) | |
tree | 379b9aedbd8518bc5a3a81f4773c5b7864ea0b7d | |
parent | 12b24a8aaec241afb8afff9796715d97d678cee2 (diff) | |
download | bukkit-320d3ca8355f710734d218c1bbd335073e8a2175.tar bukkit-320d3ca8355f710734d218c1bbd335073e8a2175.tar.gz bukkit-320d3ca8355f710734d218c1bbd335073e8a2175.tar.lz bukkit-320d3ca8355f710734d218c1bbd335073e8a2175.tar.xz bukkit-320d3ca8355f710734d218c1bbd335073e8a2175.zip |
Added method to retrieve all registered permissions
-rw-r--r-- | src/main/java/org/bukkit/plugin/PluginManager.java | 9 | ||||
-rw-r--r-- | src/main/java/org/bukkit/plugin/SimplePluginManager.java | 4 |
2 files changed, 13 insertions, 0 deletions
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<Permissible> 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<Permission> 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<Permission> getPermissions() { + return new HashSet<Permission>(permissions.values()); + } } |