Add minimessage support to prefixes

This commit is contained in:
Taah
2022-02-25 00:37:43 -08:00
parent 27daa3a858
commit 210b02ff78
2 changed files with 22 additions and 6 deletions

View File

@ -10,6 +10,7 @@ import io.papermc.paper.event.player.AsyncChatEvent;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
@ -71,7 +72,7 @@ public class ChatListener extends PlexListener
{
if (hasPrefix)
{
return Component.empty().append(LegacyComponentSerializer.legacyAmpersand().deserialize(prefix))
return Component.empty().append(MiniMessage.miniMessage().deserialize(prefix))
.append(Component.space())
.append(LegacyComponentSerializer.legacyAmpersand().deserialize("&" + plugin.config.getString("chat.name-color") + LegacyComponentSerializer.legacyAmpersand().serialize(sourceDisplayName)))
.append(Component.space())