Do not append spaces after CommandElements whose usages are empty.
@@ -476,11 +476,14 @@ protected Object parseValue(CommandSource source, CommandArgs args) throws Argum
public Text getUsage(CommandSource commander) {
final Text.Builder build = Text.builder();
for (Iterator<CommandElement> it = this.elements.iterator(); it.hasNext();) {
- build.append(it.next().getUsage(commander));
+ Text usage = it.next().getUsage(commander);
+ if (!usage.isEmpty()) {
+ build.append(usage);
if (it.hasNext()) {
build.append(CommandMessageFormatting.SPACE_TEXT);
}
}
+ }
return build.build();
}
}
