public boolean isExactMatch(String command) { for (HelpEntry helpEntry : helpEntries) { if (helpEntry.getCommand().endsWith(" " + command)) { selectedEntry = helpEntry; return true; } } return false; }
public void printDetailedHelpHeader(CommandHelp help, CommandIssuer issuer, HelpEntry entry) { issuer.sendMessage(MessageType.HELP, MessageKeys.HELP_DETAILED_HEADER, "{command}", entry.getCommand(), "{commandprefix}", help.getCommandPrefix() ); }
/** * Override this to control replacements * * @param help * @param entry * @return */ public String[] getEntryFormatReplacements(CommandHelp help, HelpEntry entry) { //{command} {parameters} {separator} {description} return new String[]{ "{command}", entry.getCommand(), "{commandprefix}", help.getCommandPrefix(), "{parameters}", entry.getParameterSyntax(), "{separator}", entry.getDescription().isEmpty() ? "" : "-", "{description}", entry.getDescription() }; }
/** * Override this to control replacements * * @param help * @param param * @param entry * @return */ @NotNull public String[] getParameterFormatReplacements(CommandHelp help, CommandParameter param, HelpEntry entry) { //{name} {description} return new String[]{ "{name}", param.getName(), "{syntax}", ACFUtil.nullDefault(param.getSyntax(), ""), "{description}", ACFUtil.nullDefault(param.getDescription(), ""), "{command}", help.getCommandName(), "{fullcommand}", entry.getCommand(), "{commandprefix}", help.getCommandPrefix() }; } }