summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/plugin/SimplePluginManager.java25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index 00fa7815..2dae74e7 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -589,6 +589,11 @@ public final class SimplePluginManager implements PluginManager {
}
public void addPermission(Permission perm) {
+ addPermission(perm, true);
+ }
+
+ @Deprecated
+ public void addPermission(Permission perm, boolean dirty) {
String name = perm.getName().toLowerCase(java.util.Locale.ENGLISH);
if (permissions.containsKey(name)) {
@@ -596,7 +601,7 @@ public final class SimplePluginManager implements PluginManager {
}
permissions.put(name, perm);
- calculatePermissionDefault(perm);
+ calculatePermissionDefault(perm, dirty);
}
public Set<Permission> getDefaultPermissions(boolean op) {
@@ -616,21 +621,31 @@ public final class SimplePluginManager implements PluginManager {
defaultPerms.get(true).remove(perm);
defaultPerms.get(false).remove(perm);
- calculatePermissionDefault(perm);
+ calculatePermissionDefault(perm, true);
}
}
- private void calculatePermissionDefault(Permission perm) {
+ private void calculatePermissionDefault(Permission perm, boolean dirty) {
if ((perm.getDefault() == PermissionDefault.OP) || (perm.getDefault() == PermissionDefault.TRUE)) {
defaultPerms.get(true).add(perm);
- dirtyPermissibles(true);
+ if (dirty) {
+ dirtyPermissibles(true);
+ }
}
if ((perm.getDefault() == PermissionDefault.NOT_OP) || (perm.getDefault() == PermissionDefault.TRUE)) {
defaultPerms.get(false).add(perm);
- dirtyPermissibles(false);
+ if (dirty) {
+ dirtyPermissibles(false);
+ }
}
}
+ @Deprecated
+ public void dirtyPermissibles() {
+ dirtyPermissibles(true);
+ dirtyPermissibles(false);
+ }
+
private void dirtyPermissibles(boolean op) {
Set<Permissible> permissibles = getDefaultPermSubscriptions(op);