Adds format builder method for replacing string with translatable message
All checks were successful
KnarCraft/KnarLib/pipeline/head This commit looks good

This commit is contained in:
2025-08-22 16:58:43 +02:00
parent 5aa16bd528
commit 42bf143e8b

View File

@@ -66,6 +66,19 @@ public final class FormatBuilder {
return this;
}
/**
* Replaces placeholders for the current string
*
* @param placeholder <p>The placeholder to replace</p>
* @param replacement <p>The replacement translatable message</p>
* @return <p>This format builder</p>
*/
public FormatBuilder replace(@NotNull String placeholder, @NotNull TranslatableMessage replacement) {
this.toFormat = StringFormatter.replacePlaceholder(this.toFormat, placeholder,
stringFormatter.getUnFormattedMessage(replacement));
return this;
}
/**
* Replaces placeholders for the current string
*