diff --git a/bukkit/src/main/java/me/lucko/luckperms/api/vault/VaultPermissionHook.java b/bukkit/src/main/java/me/lucko/luckperms/api/vault/VaultPermissionHook.java index d8735c1c..93f2c4ba 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/api/vault/VaultPermissionHook.java +++ b/bukkit/src/main/java/me/lucko/luckperms/api/vault/VaultPermissionHook.java @@ -78,7 +78,7 @@ public class VaultPermissionHook extends Permission { Map toApply = object.exportNodes( new Contexts(context, includeGlobal, includeGlobal, true, true, true), - Collections.emptyList() + Collections.emptyList(), true ); return toApply.containsKey(permission) && toApply.get(permission); @@ -217,7 +217,7 @@ public class VaultPermissionHook extends Permission { Map toApply = user.exportNodes( new Contexts(context, includeGlobal, includeGlobal, true, true, true), - Collections.emptyList() + Collections.emptyList(), true ); return toApply.entrySet().stream() 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 10617a74..4fe5b505 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/users/BukkitUser.java +++ b/bukkit/src/main/java/me/lucko/luckperms/users/BukkitUser.java @@ -71,7 +71,8 @@ public class BukkitUser extends User { plugin.getConfiguration().isApplyingGlobalGroups(), plugin.getConfiguration().isApplyingGlobalWorldGroups() ), - Collections.emptyList() + Collections.emptyList(), + true ); try { diff --git a/bungee/src/main/java/me/lucko/luckperms/users/BungeeUser.java b/bungee/src/main/java/me/lucko/luckperms/users/BungeeUser.java index 8b9f079e..9bc0d47e 100644 --- a/bungee/src/main/java/me/lucko/luckperms/users/BungeeUser.java +++ b/bungee/src/main/java/me/lucko/luckperms/users/BungeeUser.java @@ -69,7 +69,8 @@ public class BungeeUser extends User { plugin.getConfiguration().isApplyingGlobalGroups(), plugin.getConfiguration().isApplyingGlobalWorldGroups() ), - Collections.emptyList() + Collections.emptyList(), + true ); Map existing = playerCache.getPermissions(); diff --git a/common/src/main/java/me/lucko/luckperms/api/implementation/internal/PermissionHolderLink.java b/common/src/main/java/me/lucko/luckperms/api/implementation/internal/PermissionHolderLink.java index 132c1485..fcc044a7 100644 --- a/common/src/main/java/me/lucko/luckperms/api/implementation/internal/PermissionHolderLink.java +++ b/common/src/main/java/me/lucko/luckperms/api/implementation/internal/PermissionHolderLink.java @@ -262,7 +262,7 @@ public class PermissionHolderLink implements PermissionHolder { if (world != null && !world.equals("")) { extraContext.put("world", world); } - return master.exportNodes(new Contexts(extraContext, includeGlobal, includeGlobal, applyGroups, true, true), possibleNodes); + return master.exportNodes(new Contexts(extraContext, includeGlobal, includeGlobal, applyGroups, true, true), possibleNodes, false); } @Override 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 d9f388e9..c0ce7f5d 100644 --- a/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java +++ b/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java @@ -262,22 +262,23 @@ public abstract class PermissionHolder { * @param possibleNodes a list of possible nodes for wildcards and regex permissions * @return a map of permissions */ - public Map exportNodes(Contexts context, List possibleNodes) { + public Map exportNodes(Contexts context, List possibleNodes, boolean lowerCase) { Map perms = new HashMap<>(); for (Node node : getAllNodesFiltered(context)) { if (possibleNodes != null && !possibleNodes.isEmpty()) { if (node.getPermission().equals("*") || node.getPermission().equals("'*'")) { if (plugin.getConfiguration().isApplyingWildcards()) { - possibleNodes.forEach(n -> perms.put(n, true)); + possibleNodes.forEach(n -> perms.put(lowerCase ? n.toLowerCase() : n, true)); } } } - perms.put(node.getPermission(), node.getValue()); + perms.put(lowerCase ? node.getPermission().toLowerCase() : node.getPermission(), node.getValue()); if (plugin.getConfiguration().isApplyingShorthand()) { node.resolveShorthand().stream() + .map(s -> lowerCase ? s.toLowerCase() : s) .filter(s -> !perms.containsKey(s)) .forEach(s -> perms.put(s, node.getValue())); } @@ -285,6 +286,7 @@ public abstract class PermissionHolder { if (possibleNodes != null && !possibleNodes.isEmpty()) { if (plugin.getConfiguration().isApplyingWildcards()) { node.resolveWildcard(possibleNodes).stream() + .map(s -> lowerCase ? s.toLowerCase() : s) .filter(s -> !perms.containsKey(s)) .forEach(s -> perms.put(s, node.getValue())); } @@ -576,7 +578,7 @@ public abstract class PermissionHolder { if (world != null && !world.equals("")) { context.put("world", world); } - return exportNodes(new Contexts(context, plugin.getConfiguration().isIncludingGlobalPerms(), true, true, true, true), Collections.emptyList()); + return exportNodes(new Contexts(context, plugin.getConfiguration().isIncludingGlobalPerms(), true, true, true, true), Collections.emptyList(), false); } @Deprecated @@ -588,7 +590,7 @@ public abstract class PermissionHolder { if (world != null && !world.equals("")) { context.put("world", world); } - return exportNodes(new Contexts(context, plugin.getConfiguration().isIncludingGlobalPerms(), true, true, true, true), Collections.emptyList()); + return exportNodes(new Contexts(context, plugin.getConfiguration().isIncludingGlobalPerms(), true, true, true, true), Collections.emptyList(), false); } @SuppressWarnings("deprecation") diff --git a/sponge/src/main/java/me/lucko/luckperms/api/sponge/LuckPermsUserSubject.java b/sponge/src/main/java/me/lucko/luckperms/api/sponge/LuckPermsUserSubject.java index 34484f76..1b904293 100644 --- a/sponge/src/main/java/me/lucko/luckperms/api/sponge/LuckPermsUserSubject.java +++ b/sponge/src/main/java/me/lucko/luckperms/api/sponge/LuckPermsUserSubject.java @@ -39,7 +39,6 @@ import org.spongepowered.api.util.Tristate; import java.util.*; import java.util.concurrent.ConcurrentHashMap; -import java.util.function.Function; import java.util.stream.Collectors; public class LuckPermsUserSubject extends LuckPermsSubject { @@ -83,7 +82,8 @@ public class LuckPermsUserSubject extends LuckPermsSubject { service.getPlugin().getConfiguration().isApplyingGlobalGroups(), service.getPlugin().getConfiguration().isApplyingGlobalWorldGroups() ), - Collections.emptyList() + Collections.emptyList(), + true ); ContextData existing = contextData.get(context);