alias to command suggestions
This commit is contained in:
parent
8357525eaa
commit
11982fb396
1 changed files with 12 additions and 5 deletions
|
@ -34,11 +34,18 @@ public class CommandSuggestionPlugin extends ChatPlugin.Listener {
|
||||||
output.add(Component.text(id));
|
output.add(Component.text(id));
|
||||||
|
|
||||||
for (Command command : CommandHandlerPlugin.commands) {
|
for (Command command : CommandHandlerPlugin.commands) {
|
||||||
output.add(
|
final boolean hasAliases = command.aliases.length != 0;
|
||||||
Component
|
|
||||||
.text(command.name)
|
Component outputComponent = Component
|
||||||
.append(Component.text(command.trustLevel.name()))
|
.text(command.name)
|
||||||
);
|
.append(Component.text(command.trustLevel.name()))
|
||||||
|
.append(Component.text(hasAliases));
|
||||||
|
|
||||||
|
if (hasAliases) {
|
||||||
|
for (String alias : command.aliases) outputComponent = outputComponent.append(Component.text(alias));
|
||||||
|
}
|
||||||
|
|
||||||
|
output.add(outputComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
bot.chat.tellraw(Component.join(JoinConfiguration.noSeparators(), output), player);
|
bot.chat.tellraw(Component.join(JoinConfiguration.noSeparators(), output), player);
|
||||||
|
|
Loading…
Reference in a new issue