Skip to content

Commit

Permalink
Proper fix for subcommand permissions (#159)
Browse files Browse the repository at this point in the history
Signed-off-by: Lyfts <127234178+Lyfts@users.noreply.github.com>
  • Loading branch information
Lyfts authored Dec 16, 2024
1 parent e820429 commit 4a887ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/serverutils/lib/command/CommandTreeBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public List<String> addTabCompletionOptions(ICommandSender sender, String[] args
List<String> keys = new ArrayList<>();

for (ICommand c : getSubCommands()) {
if (c.canCommandSenderUseCommand(sender)) {
if (canUseSubcommand(sender, c)) {
keys.add(c.getCommandName());
}
}
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 4a887ca

Please sign in to comment.