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()) {
|
for (CompositeCommand subCommand: cmd.getSubCommands().values()) {
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
// Player
|
// Player
|
||||||
if (subCommand.getPermission().isEmpty() || sender.hasPermission(subCommand.getPermission())) {
|
if (subCommand.getPermission().isEmpty() || sender.hasPermission(subCommand.getPermission()) || sender.isOp()) {
|
||||||
// Permission is okay
|
// Permission is okay
|
||||||
options.add(subCommand.getLabel());
|
options.add(subCommand.getLabel());
|
||||||
}
|
}
|
||||||
|
@ -84,14 +84,14 @@ public class DefaultHelpCommand extends CompositeCommand {
|
|||||||
Optional<CompositeCommand> sub = subCommand.getSubCommand(HELP);
|
Optional<CompositeCommand> sub = subCommand.getSubCommand(HELP);
|
||||||
sub.ifPresent(compositeCommand -> compositeCommand.execute(user, HELP, Collections.singletonList(String.valueOf(newDepth))));
|
sub.ifPresent(compositeCommand -> compositeCommand.execute(user, HELP, Collections.singletonList(String.valueOf(newDepth))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean showPrettyHelp(User user, String usage, String params, String desc) {
|
private boolean showPrettyHelp(User user, String usage, String params, String desc) {
|
||||||
// Show the help
|
// Show the help
|
||||||
if (user.isPlayer()) {
|
if (user.isPlayer()) {
|
||||||
// Player. Check perms
|
// 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);
|
user.sendMessage(HELP_SYNTAX_REF, USAGE_PLACEHOLDER, usage, PARAMS_PLACEHOLDER, params, DESC_PLACEHOLDER, desc);
|
||||||
} else {
|
} else {
|
||||||
// No permission, nothing to see here. If you don't have permission, you cannot see any sub commands
|
// 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