Adds format builder method for replacing string with translatable message
All checks were successful
KnarCraft/KnarLib/pipeline/head This commit looks good
All checks were successful
KnarCraft/KnarLib/pipeline/head This commit looks good
This commit is contained in:
@@ -66,6 +66,19 @@ public final class FormatBuilder {
|
|||||||
return this;
|
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
|
* Replaces placeholders for the current string
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user