mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 03:43:40 +01:00
Speed up permission recalculation.
Based on ideas in PR #102, but rewritten for correctness. By: md_5 <git@md-5.net>
This commit is contained in:
parent
441f6fa9c2
commit
ef91dacfe8
2 changed files with 2 additions and 1 deletions
|
@ -52,6 +52,7 @@ public class Permission {
|
|||
}
|
||||
|
||||
public Permission(String name, String description, PermissionDefault defaultValue, Map<String, Boolean> children) {
|
||||
Validate.notNull(name, "Name cannot be null");
|
||||
this.name = name;
|
||||
this.description = (description == null) ? "" : description;
|
||||
|
||||
|
|
|
@ -615,7 +615,7 @@ public final class SimplePluginManager implements PluginManager {
|
|||
}
|
||||
|
||||
public void recalculatePermissionDefaults(Permission perm) {
|
||||
if (permissions.containsValue(perm)) {
|
||||
if (perm != null && permissions.containsKey(perm.getName().toLowerCase())) {
|
||||
defaultPerms.get(true).remove(perm);
|
||||
defaultPerms.get(false).remove(perm);
|
||||
|
||||
|
|
Loading…
Reference in a new issue