Skip to content

Commit

Permalink
use testPermissionSilent when filtering command suggestions (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
Grabsky authored Jun 18, 2024
1 parent 91e14bd commit 14a9bac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public List<String> suggestNumber(final CommandContext<CommandSender> context, f
@Suggestions("PlayerCommandCMD/commands") // Suggests allowed (non-blocked) commands accessible by the command sender.
public Collection<String> suggestCommand(final CommandContext<CommandSender> context, final CommandInput input) {
return Bukkit.getServer().getCommandMap().getKnownCommands().values().stream()
.filter(command -> !command.getName().contains(":") && command.testPermission(context.sender()) && !hasBlockedCommands(command.getName()))
.filter(command -> !command.getName().contains(":") && command.testPermissionSilent(context.sender()) && !hasBlockedCommands(command.getName()))
.map(org.bukkit.command.Command::getName)
.toList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public List<String> suggestNumber(final CommandContext<CommandSender> context, f
@Suggestions("ServerCommandCMD/commands") // Suggests allowed (non-blocked) commands accessible by the command sender.
public Collection<String> suggestCommand(final CommandContext<CommandSender> context, final CommandInput input) {
return Bukkit.getServer().getCommandMap().getKnownCommands().values().stream()
.filter(command -> !command.getName().contains(":") && command.testPermission(context.sender()) && !hasBlockedCommands(command.getName()))
.filter(command -> !command.getName().contains(":") && command.testPermissionSilent(context.sender()) && !hasBlockedCommands(command.getName()))
.map(org.bukkit.command.Command::getName)
.toList();
}
Expand Down

0 comments on commit 14a9bac

Please sign in to comment.