public MultipleCommandAliasHelpTopic(MultipleCommandAlias alias) { this.alias = alias; name = "/" + alias.getLabel(); // Build short text StringBuilder sb = new StringBuilder(); for (int i = 0; i < alias.getCommands().length; i++) { if (i != 0) { sb.append(ChatColor.GOLD + " > " + ChatColor.WHITE); } sb.append("/"); sb.append(alias.getCommands()[i].getLabel()); } shortText = sb.toString(); // Build full text fullText = ChatColor.GOLD + "Alias for: " + ChatColor.WHITE + getShortText(); }
public MultipleCommandAliasHelpTopic(MultipleCommandAlias alias) { this.alias = alias; name = "/" + alias.getLabel(); // Build short text StringBuilder sb = new StringBuilder(); for (int i = 0; i < alias.getCommands().length; i++) { if (i != 0) { sb.append(ChatColor.GOLD).append(" > ").append(ChatColor.WHITE);// >> /* https://pmd.github.io/pmd-5.4.1/pmd-java/rules/java/strings.html#InefficientStringBuffering */ } sb.append('/');// 1 symbol ~ char sb.append(alias.getCommands()[i].getLabel()); } shortText = sb.toString(); // Build full text fullText = ChatColor.GOLD + "Alias for: " + ChatColor.WHITE + getShortText(); }
public HelpTopic createTopic(MultipleCommandAlias multipleCommandAlias) { return new MultipleCommandAliasHelpTopic(multipleCommandAlias); }