use of dev.rosewood.rosegarden.manager.AbstractLocaleManager in project RoseGarden by Rosewood-Development.
the class BaseCommand method execute.
@RoseExecutable
public void execute(CommandContext context) {
AbstractLocaleManager localeManager = this.rosePlugin.getManager(AbstractLocaleManager.class);
String baseColor = localeManager.getLocaleMessage("base-command-color");
localeManager.sendCustomMessage(context.getSender(), baseColor + "Running <g:#8A2387:#E94057:#F27121>" + this.rosePlugin.getDescription().getName() + baseColor + " v" + this.rosePlugin.getDescription().getVersion());
localeManager.sendCustomMessage(context.getSender(), baseColor + "Plugin created by: <g:#41E0F0:#FF8DCE>" + this.rosePlugin.getDescription().getAuthors().get(0));
localeManager.sendSimpleMessage(context.getSender(), "base-command-help", StringPlaceholders.single("cmd", this.parent.getName()));
}
use of dev.rosewood.rosegarden.manager.AbstractLocaleManager 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