use of dev.rosewood.rosegarden.utils.StringPlaceholders in project RoseGarden by Rosewood-Development.
the class HelpCommand method execute.
@RoseExecutable
public void execute(CommandContext context) {
AbstractLocaleManager localeManager = this.rosePlugin.getManager(AbstractLocaleManager.class);
localeManager.sendCommandMessage(context.getSender(), "command-help-title");
for (RoseCommand command : this.parent.getCommands()) {
if (!command.hasHelp() || !command.canUse(context.getSender()))
continue;
StringPlaceholders stringPlaceholders = StringPlaceholders.builder("cmd", this.parent.getName()).addPlaceholder("subcmd", command.getName().toLowerCase()).addPlaceholder("args", command.getArgumentsString()).addPlaceholder("desc", localeManager.getLocaleMessage(command.getDescriptionKey())).build();
localeManager.sendSimpleCommandMessage(context.getSender(), "command-help-list-description" + (command.getNumParameters() == 0 ? "-no-args" : ""), stringPlaceholders);
}
}
Aggregations