Account for Sponge permission defaults in SpongeSenderFactory#getPermissionValue (fixes #920)

This commit is contained in:
Luck 2018-04-20 14:17:29 +01:00
parent 4704c5c975
commit 882a29029e
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -74,7 +74,14 @@ public class SpongeSenderFactory extends SenderFactory<CommandSource> {
@Override
protected Tristate getPermissionValue(CommandSource source, String node) {
return CompatibilityUtil.convertTristate(source.getPermissionValue(source.getActiveContexts(), node));
Tristate ret = CompatibilityUtil.convertTristate(source.getPermissionValue(source.getActiveContexts(), node));
// check the permdefault
if (ret == Tristate.UNDEFINED && source.hasPermission(node)) {
ret = Tristate.TRUE;
}
return ret;
}
@Override