diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java index eb3a0a35..5b68c722 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/VaultPermissionHook.java @@ -376,7 +376,7 @@ public class VaultPermissionHook extends Permission { } if (pgoCheckMemberOf) { - if (!user.getLocalGroups(server, world).contains(group.toLowerCase())) { + if (!user.getLocalGroups(server, world, isIncludeGlobal()).contains(group.toLowerCase())) { continue; } } diff --git a/common/src/main/java/me/lucko/luckperms/common/core/PermissionHolder.java b/common/src/main/java/me/lucko/luckperms/common/core/PermissionHolder.java index b76bc8a1..1f1db374 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/PermissionHolder.java +++ b/common/src/main/java/me/lucko/luckperms/common/core/PermissionHolder.java @@ -890,6 +890,15 @@ public abstract class PermissionHolder { .collect(Collectors.toList()); } + public List getLocalGroups(String server, String world, boolean includeGlobal) { + return getNodes().stream() + .filter(Node::isGroupNode) + .filter(n -> n.shouldApplyOnWorld(world, includeGlobal, true)) + .filter(n -> n.shouldApplyOnServer(server, includeGlobal, true)) + .map(Node::getGroupName) + .collect(Collectors.toList()); + } + /** * Get a {@link List} of the groups the holder inherits on a specific server * @param server the server to check