Ignore negated primary group override nodes & fix broken message

This commit is contained in:
Luck 2016-10-30 15:29:55 +00:00
parent ba2f6eb7be
commit 17b06c39e9
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
2 changed files with 9 additions and 1 deletions

View File

@ -327,6 +327,10 @@ public class VaultPermissionHook extends Permission {
if (pgoCheckInherited) {
PermissionData data = user.getUserData().getPermissionData(createContext(server, world));
for (Map.Entry<String, Boolean> e : data.getImmutableBacking().entrySet()) {
if (!e.getValue()) {
continue;
}
if (!e.getKey().toLowerCase().startsWith("vault.primarygroup.")) {
continue;
}
@ -348,6 +352,10 @@ public class VaultPermissionHook extends Permission {
}
} else {
for (LocalizedNode node : user.getPermissions(true)) {
if (!node.getValue()) {
continue;
}
if (!node.getPermission().toLowerCase().startsWith("vault.primarygroup.")) {
continue;
}

View File

@ -172,7 +172,7 @@ public enum Message {
UNSET_TEMP_PERMISSION_SERVER_WORLD_SUCCESS("&aUnset temporary permission &b{0}&a for &b{1}&a on server &b{2}&a, world &b{3}&a.", true),
SET_INHERIT_SUCCESS("&b{0}&a now inherits permissions from &b{1}&a.", true),
SET_INHERIT_SERVER_SUCCESS("&b{0}&a now inherits permissions from &b{2}&a on server &b{3}&a.", true),
SET_INHERIT_SERVER_SUCCESS("&b{0}&a now inherits permissions from &b{1}&a on server &b{2}&a.", true),
SET_INHERIT_SERVER_WORLD_SUCCESS("&b{0}&a now inherits permissions from &b{1}&a on server &b{2}&a, world &b{3}&a.", true),
SET_TEMP_INHERIT_SUCCESS("&b{0}&a now inherits permissions from &b{1}&a for a duration of &b{2}&a.", true),
SET_TEMP_INHERIT_SERVER_SUCCESS("&b{0}&a now inherits permissions from &b{1}&a on server &b{2}&a for a duration of &b{3}&a.", true),