From 2fba9b83af259b274f80cd26d98cdb33d91f116c Mon Sep 17 00:00:00 2001 From: Luck Date: Wed, 7 Dec 2016 21:18:57 +0000 Subject: [PATCH] apply group rewrites to vault - resolves #59 --- .../luckperms/bukkit/vault/VaultPermissionHook.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 082be92b6..6aa40a8ca 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 @@ -248,8 +248,7 @@ public class VaultPermissionHook extends Permission { .filter(n -> n.shouldApplyOnServer(server, isIncludeGlobal(), false)) .filter(n -> n.shouldApplyOnWorld(finalWorld, true, false)) .map(Node::getGroupName) - .filter(s -> s.equalsIgnoreCase(group)) - .findAny().isPresent(); + .anyMatch(s -> s.equalsIgnoreCase(group)); } @Override @@ -329,7 +328,8 @@ public class VaultPermissionHook extends Permission { } if (!pgo) { - return user.getPrimaryGroup(); + String g = user.getPrimaryGroup(); + return plugin.getConfiguration().getGroupNameRewrites().getOrDefault(g, g); } if (pgoCheckInherited) { @@ -394,7 +394,8 @@ public class VaultPermissionHook extends Permission { } // Fallback - return user.getPrimaryGroup(); + String g = user.getPrimaryGroup(); + return plugin.getConfiguration().getGroupNameRewrites().getOrDefault(g, g); } @Override