From 4a887caf3def948469b9b0b647dce5f9fdcfd6dd Mon Sep 17 00:00:00 2001 From: Lyft <127234178+Lyfts@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:37:55 +0100 Subject: [PATCH] Proper fix for subcommand permissions (#159) Signed-off-by: Lyfts <127234178+Lyfts@users.noreply.github.com> --- src/main/java/serverutils/lib/command/CommandTreeBase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/serverutils/lib/command/CommandTreeBase.java b/src/main/java/serverutils/lib/command/CommandTreeBase.java index bedbd3d3..35399e21 100644 --- a/src/main/java/serverutils/lib/command/CommandTreeBase.java +++ b/src/main/java/serverutils/lib/command/CommandTreeBase.java @@ -77,7 +77,7 @@ public List addTabCompletionOptions(ICommandSender sender, String[] args List keys = new ArrayList<>(); for (ICommand c : getSubCommands()) { - if (c.canCommandSenderUseCommand(sender)) { + if (canUseSubcommand(sender, c)) { keys.add(c.getCommandName()); } } @@ -122,7 +122,7 @@ public void processCommand(ICommandSender sender, String[] args) throws CommandE "commands.tree_base.invalid_cmd.list_subcommands", args[0], subCommandsString); - } else if (!cmd.canCommandSenderUseCommand(sender)) { + } else if (!canUseSubcommand(sender, cmd)) { throw new CommandException("commands.generic.permission"); } else { cmd.processCommand(sender, shiftArgs(args));