Brigadier Command Support (#8235)
Adds the ability for plugins to register their own brigadier commands --------- Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Co-authored-by: Bjarne Koll <git@lynxplay.dev>
This commit is contained in:
@@ -60,12 +60,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
public static String getPermission(CommandNode<CommandSourceStack> vanillaCommand) {
|
||||
- return "minecraft.command." + ((vanillaCommand.getRedirect() == null) ? vanillaCommand.getName() : vanillaCommand.getRedirect().getName());
|
||||
+ // Paper start - Vanilla command permission fixes
|
||||
+ final String commandName;
|
||||
+ if (vanillaCommand.getRedirect() == null) {
|
||||
+ commandName = vanillaCommand.getName();
|
||||
+ } else {
|
||||
+ commandName = vanillaCommand.getRedirect().getName();
|
||||
+ while (vanillaCommand.getRedirect() != null) {
|
||||
+ vanillaCommand = vanillaCommand.getRedirect();
|
||||
+ }
|
||||
+ final String commandName = vanillaCommand.getName();
|
||||
+ return "minecraft.command." + stripDefaultNamespace(commandName);
|
||||
+ }
|
||||
+
|
||||
|
||||
Reference in New Issue
Block a user