From ab00c414526f3501c4126c76e1a0347540dbd0aa Mon Sep 17 00:00:00 2001 From: Luck Date: Tue, 30 Aug 2016 13:06:36 +0100 Subject: [PATCH] Fix NPE, and properly send possible permissions in BukkitUser --- .../main/java/me/lucko/luckperms/users/BukkitUser.java | 9 ++++++++- .../java/me/lucko/luckperms/core/PermissionHolder.java | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bukkit/src/main/java/me/lucko/luckperms/users/BukkitUser.java b/bukkit/src/main/java/me/lucko/luckperms/users/BukkitUser.java index 5f1edd88..377a8d78 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/users/BukkitUser.java +++ b/bukkit/src/main/java/me/lucko/luckperms/users/BukkitUser.java @@ -72,7 +72,14 @@ public class BukkitUser extends User { } // Calculate the permissions that should be applied. This is done async, who cares about how long it takes or how often it's done. - Map toApply = getLocalPermissions(getPlugin().getConfiguration().getServer(), plugin.getUserManager().getWorldCache().get(getUuid()), null); + Map toApply = exportNodes( + getPlugin().getConfiguration().getServer(), + plugin.getUserManager().getWorldCache().get(getUuid()), + null, + plugin.getConfiguration().getIncludeGlobalPerms(), + true, + plugin.getPossiblePermissions() + ); try { // The map in the LP PermissionAttachment is a ConcurrentHashMap. We can modify it's contents async. diff --git a/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java b/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java index d3c02c13..39bbc5ba 100644 --- a/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java +++ b/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java @@ -228,8 +228,8 @@ public abstract class PermissionHolder { Map perms = new HashMap<>(); for (Node node : getAllNodesFiltered(server, world, extraContext, includeGlobal, applyGroups)) { - if (plugin.getConfiguration().getApplyWildcards()) { - if (node.getPermission().equals("*") || node.getPermission().equals("'*'")) { + if (node.getPermission().equals("*") || node.getPermission().equals("'*'")) { + if (possibleNodes != null && plugin.getConfiguration().getApplyWildcards()) { possibleNodes.forEach(n -> perms.put(n, true)); continue; }