mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-10-22 12:20:26 +02:00
Add method to allow Number and Boolean types for placeholders
This commit is contained in:
parent
0f2aff788f
commit
265e5864c9
@ -147,7 +147,7 @@ public class Message {
|
||||
* Interchangeably Supports {@code %value%} and {@code {value}}
|
||||
*
|
||||
* @param placeholder the placeholder to replace
|
||||
* @param replacement the replacement object
|
||||
* @param replacement the replacement String
|
||||
*
|
||||
* @return the modified Message
|
||||
*/
|
||||
@ -158,6 +158,19 @@ public class Message {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace the provided placeholder with the provided object. <br />
|
||||
* Interchangeably Supports {@code %value%} and {@code {value}}
|
||||
*
|
||||
* @param placeholder the placeholder to replace
|
||||
* @param replacement the replacement Number
|
||||
*
|
||||
* @return the modified Message
|
||||
*/
|
||||
public Message processPlaceholder(String placeholder, Number replacement) {
|
||||
return processPlaceholder(placeholder, replacement == null ? "" : replacement.toString());
|
||||
}
|
||||
|
||||
Message setPrefix(String prefix) {
|
||||
this.prefix = AdventureUtils.formatComponent(prefix + " ");
|
||||
return this;
|
||||
|
Loading…
Reference in New Issue
Block a user