This commit is contained in:
HaHaWTH 2024-02-26 01:30:10 +08:00
parent e3c460e614
commit d305fe6679
2 changed files with 5 additions and 4 deletions

View File

@ -660,6 +660,7 @@
<version>2.2.2-SNAPSHOT</version> <version>2.2.2-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- Jalu Injector --> <!-- Jalu Injector -->
<dependency> <dependency>
<groupId>ch.jalu</groupId> <groupId>ch.jalu</groupId>

View File

@ -84,14 +84,14 @@ public final class CommandUtils {
* @return formatted command syntax incl. arguments * @return formatted command syntax incl. arguments
*/ */
public static String buildSyntax(CommandDescription command, List<String> correctLabels) { public static String buildSyntax(CommandDescription command, List<String> correctLabels) {
String commandSyntax = ChatColor.WHITE + "/" + correctLabels.get(0) + ChatColor.YELLOW; StringBuilder commandSyntax = new StringBuilder(ChatColor.WHITE + "/" + correctLabels.get(0) + ChatColor.YELLOW);
for (int i = 1; i < correctLabels.size(); ++i) { for (int i = 1; i < correctLabels.size(); ++i) {
commandSyntax += " " + correctLabels.get(i); commandSyntax.append(" ").append(correctLabels.get(i));
} }
for (CommandArgumentDescription argument : command.getArguments()) { for (CommandArgumentDescription argument : command.getArguments()) {
commandSyntax += " " + formatArgument(argument); commandSyntax.append(" ").append(formatArgument(argument));
} }
return commandSyntax; return commandSyntax.toString();
} }
/** /**