Fix placeholder value is not parsed for colors

This commit is contained in:
ceze88 2024-07-16 17:29:36 +02:00
parent 9b7e65992a
commit 4e4b1529ab
2 changed files with 3 additions and 3 deletions

View File

@ -434,7 +434,7 @@ public class AdventureUtils {
public static Component formatPlaceholder(Component message, MiniMessagePlaceholder... placeholder) {
return message.replaceText(builder -> {
for (MiniMessagePlaceholder place : placeholder) {
builder.matchLiteral(place.getPlaceholder()).replacement(place.getValue());
builder.matchLiteral(place.getPlaceholder()).replacement(formatComponent(place.getValue()));
}
});
}

View File

@ -152,8 +152,8 @@ public class Message {
* @return the modified Message
*/
public Message processPlaceholder(String placeholder, Object replacement) {
MiniMessagePlaceholder placeholderProcessor = new MiniMessagePlaceholder(placeholder, replacement == null ? "" : replacement.toString());
this.message = AdventureUtils.formatPlaceholder(this.message, placeholderProcessor);
MiniMessagePlaceholder miniMessagePlaceholder = new MiniMessagePlaceholder(placeholder, replacement == null ? "" : replacement.toString());
this.message = AdventureUtils.formatPlaceholder(this.message, miniMessagePlaceholder);
return this;
}