Subscribe to default permissions too

This commit is contained in:
Luck 2017-01-14 23:49:45 +00:00
parent 6501e5cf8d
commit f1a1612f5d
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
2 changed files with 9 additions and 1 deletions

View File

@ -84,6 +84,7 @@ public class DefaultsProvider {
@Getter
private Map<String, Boolean> opDefaults = ImmutableMap.of();
private final DummyPermissible opDummy = new DummyPermissible(this::refreshOp);
@Getter
private Map<String, Boolean> nonOpDefaults = ImmutableMap.of();
private final DummyPermissible nonOpDummy = new DummyPermissible(this::refreshNonOp);

View File

@ -92,7 +92,14 @@ public class LPPermissible extends PermissibleBase {
}
public void updateSubscriptions() {
Set<String> ent = user.getUserData().getPermissionData(calculateContexts()).getImmutableBacking().keySet();
Set<String> ent = new HashSet<>(user.getUserData().getPermissionData(calculateContexts()).getImmutableBacking().keySet());
if (parent.isOp()) {
ent.addAll(plugin.getDefaultsProvider().getOpDefaults().keySet());
} else {
ent.addAll(plugin.getDefaultsProvider().getNonOpDefaults().keySet());
}
subscriptions.subscribe(ent);
}