mirror of
https://github.com/songoda/SongodaCore.git
synced 2025-02-17 03:51:27 +01:00
Better placeholder replacing
This commit is contained in:
parent
3a43b55e70
commit
4ba9254913
@ -422,10 +422,13 @@ public class AdventureUtils {
|
||||
}
|
||||
|
||||
public static Component formatPlaceholder(Component message, MiniMessagePlaceholder... placeholder) {
|
||||
return AdventureUtils.formatComponent(AdventureUtils.replaceLegacy(AdventureUtils.toLegacy(message)), placeholder);
|
||||
return message.replaceText(builder -> {
|
||||
for (MiniMessagePlaceholder place : placeholder) {
|
||||
builder.matchLiteral(place.getPlaceholder()).replacement(place.getValue());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//Bukkit defaults for time
|
||||
public static Title createTitle (Component title, Component subtitle) {
|
||||
return Title.title(title, subtitle, Title.Times.times(
|
||||
|
Loading…
Reference in New Issue
Block a user