Skip to content

Commit

Permalink
Fix some formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
thecatcore committed Nov 28, 2024
1 parent 5cbca13 commit 9f8bb6e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ public void parse(PermissibleCommandSource source, CommandArgs args, CommandCont

if (ex instanceof ArgumentParseException.WithUsage) {
// This indicates a previous child failed, so we just prepend our child
throw new ArgumentParseException.WithUsage(ex, new LiteralText(key + " " + ((ArgumentParseException.WithUsage) ex).getUsage()));
throw new ArgumentParseException.WithUsage(ex, new LiteralText(key + " " + ((ArgumentParseException.WithUsage) ex).getUsage().asUnformattedString()));
}

throw new ArgumentParseException.WithUsage(ex, new LiteralText(key + " " + mapping.getCallable().getUsage(source)));
throw new ArgumentParseException.WithUsage(ex, new LiteralText(key + " " + mapping.getCallable().getUsage(source).asUnformattedString()));
}
} else {
// Not a child, so let's continue with the fallback.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ public Optional<Text> getHelp(PermissibleCommandSource source) {
Preconditions.checkNotNull(source, "source");
StringBuilder builder = new StringBuilder();
this.getShortDescription(source).ifPresent((a) -> builder.append(a.asUnformattedString()).append("\n"));
builder.append(this.getUsage(source));
builder.append(this.getUsage(source).asUnformattedString());
this.getExtendedDescription(source).ifPresent((a) -> builder.append(a.asUnformattedString()).append("\n"));
return Optional.of(new LiteralText(builder.toString()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public CommandResult process(PermissibleCommandSource source, String command) {
usage = mapping.get().getCallable().getUsage(source);
}

source.sendMessage(CommandMessageFormatting.error(new LiteralText(String.format("Usage: /%s %s", argSplit[0], usage))));
source.sendMessage(CommandMessageFormatting.error(new LiteralText(String.format("Usage: /%s %s", argSplit[0], usage.asUnformattedString()))));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void execute(CommandSource source, String[] args) {
usage = this.mapping.getCallable().getUsage((PermissibleCommandSource) source);
}

source.sendMessage(CommandMessageFormatting.error(new LiteralText(String.format("Usage: /%s %s", this.getCommandName(), usage))));
source.sendMessage(CommandMessageFormatting.error(new LiteralText(String.format("Usage: /%s %s", this.getCommandName(), usage.asUnformattedString()))));
}
}
} catch (Throwable t) {
Expand Down

0 comments on commit 9f8bb6e

Please sign in to comment.