Added help text top and bottom

Fixed top-level-command weirdness. / is required in getUsage().
This commit is contained in:
Tastybento 2018-01-03 08:21:49 -08:00
parent d86c763716
commit 7e9a287143
3 changed files with 8 additions and 2 deletions

View File

@ -28,7 +28,7 @@ general:
commands:
help:
header: "&7=========== &c%bsb_plugin_name% &7==========="
syntax: "&7/&b[usage] &a[parameters] &7: &e[description]"
syntax: "&b[usage] &a[parameters] &7: &e[description]"
end: "&7================================="
admin:
help:

View File

@ -289,7 +289,7 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi
@Override
public String getUsage() {
return usage;
return "/" + usage;
}
/**

View File

@ -23,6 +23,9 @@ public class DefaultHelpCommand extends CompositeCommand {
@Override
public boolean execute(User user, List<String> args) {
if (parent.getLevel() == 0) {
user.sendMessage("commands.help.header");
}
if (args.isEmpty()) {
if (!parent.getLabel().equals("help")) {
// Get elements
@ -55,6 +58,9 @@ public class DefaultHelpCommand extends CompositeCommand {
}
}
}
if (parent.getLevel() == 0) {
user.sendMessage("commands.help.end");
}
return true;
}