mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-02 06:28:13 +01:00
Fixed bug where Ops could not see admin help by default.
This commit is contained in:
parent
9920e31abb
commit
0b77225f06
@ -483,7 +483,7 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi
|
||||
for (CompositeCommand subCommand: cmd.getSubCommands().values()) {
|
||||
if (sender instanceof Player) {
|
||||
// Player
|
||||
if (subCommand.getPermission().isEmpty() || sender.hasPermission(subCommand.getPermission())) {
|
||||
if (subCommand.getPermission().isEmpty() || sender.hasPermission(subCommand.getPermission()) || sender.isOp()) {
|
||||
// Permission is okay
|
||||
options.add(subCommand.getLabel());
|
||||
}
|
||||
|
@ -84,14 +84,14 @@ public class DefaultHelpCommand extends CompositeCommand {
|
||||
Optional<CompositeCommand> sub = subCommand.getSubCommand(HELP);
|
||||
sub.ifPresent(compositeCommand -> compositeCommand.execute(user, HELP, Collections.singletonList(String.valueOf(newDepth))));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean showPrettyHelp(User user, String usage, String params, String desc) {
|
||||
// Show the help
|
||||
if (user.isPlayer()) {
|
||||
// Player. Check perms
|
||||
if (user.hasPermission(parent.getPermission())) {
|
||||
if (user.isOp() || user.hasPermission(parent.getPermission())) {
|
||||
user.sendMessage(HELP_SYNTAX_REF, USAGE_PLACEHOLDER, usage, PARAMS_PLACEHOLDER, params, DESC_PLACEHOLDER, desc);
|
||||
} else {
|
||||
// No permission, nothing to see here. If you don't have permission, you cannot see any sub commands
|
||||
|
Loading…
Reference in New Issue
Block a user