8000 Fix `CommandNamespaceTests` · CommandAPI/CommandAPI@1f03bc4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1f03bc4

Browse files
committed
Fix CommandNamespaceTests
I messed this up when rebasing changes from #509 into `dev/command-build-rewrite`
1 parent 44ad1f0 commit 1f03bc4

File tree

1 file changed

+8
-1
lines changed
  • commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi

1 file changed

+8
-1
lines changed

commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/CommandAPIBukkit.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,14 @@ public void postCommandRegistration(List<RegisteredCommand> registeredCommands,
603603

604604
// Do the same for the namespaced version of the command
605605
String namespace = commonCommandInformation.namespace().toLowerCase();
606-
if(!namespace.isEmpty()) permissionsToFix.putIfAbsent(namespace + ":" + commandName, permission);
606+
permissionsToFix.putIfAbsent(namespace + ":" + commandName, permission);
607+
608+
// Do the same for the aliases
609+
for (String alias : commonCommandInformation.aliases()) {
610+
alias = alias.toLowerCase();
611+
permissionsToFix.putIfAbsent(alias, permission);
612+
permissionsToFix.putIfAbsent(namespace + ":" + alias, permission);
613+
}
607614
}
608615
}
609616

0 commit comments

Comments
 (0)
0