diff --git a/src/main/java/net/knarcraft/knarlib/formatting/FormatBuilder.java b/src/main/java/net/knarcraft/knarlib/formatting/FormatBuilder.java index 3db6e9d..26e6c3b 100644 --- a/src/main/java/net/knarcraft/knarlib/formatting/FormatBuilder.java +++ b/src/main/java/net/knarcraft/knarlib/formatting/FormatBuilder.java @@ -236,6 +236,24 @@ public class FormatBuilder { FormatBuilder.stringFormatter.displayNeutralMessage(commandSender, getCurrentString()); } + /** + * Displays the result a colored message with no prefix to the specified command sender + * + * @param commandSender

The recipient

+ */ + public void displayColored(@NotNull CommandSender commandSender) { + commandSender.sendMessage(color().getCurrentString()); + } + + /** + * Displays the result as-is to the specified command sender + * + * @param commandSender

The recipient

+ */ + public void displayRaw(@NotNull CommandSender commandSender) { + commandSender.sendMessage(getCurrentString()); + } + @NotNull @Override public String toString() { @@ -264,7 +282,7 @@ public class FormatBuilder { * @throws IllegalStateException

If the string formatter has not been set, and the input is a translatable message.

*/ @NotNull - protected String asString(@NotNull K input, @NotNull String delimiter) { + protected String asString(@NotNull K input, @NotNull String delimiter) { if (input instanceof String string) { return string; } else if (input instanceof TranslatableMessage translatableMessage) {