make papi util use minimessage serializer instead of legacy serializer because legacy serializer downsamples hex colors

This commit is contained in:
Pyrbu 2023-06-28 02:53:21 +02:00
parent c617766516
commit c0df2f6915

@ -2,7 +2,7 @@ package lol.pyr.znpcsplus.util;
import me.clip.placeholderapi.PlaceholderAPI; import me.clip.placeholderapi.PlaceholderAPI;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import net.kyori.adventure.text.minimessage.MiniMessage;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -22,7 +22,7 @@ public class PapiUtil {
// Ugly workaround would be cool if a better solution existed // Ugly workaround would be cool if a better solution existed
public static Component set(Player player, Component component) { public static Component set(Player player, Component component) {
if (!isSupported()) return component; if (!isSupported()) return component;
LegacyComponentSerializer serializer = LegacyComponentSerializer.legacySection(); MiniMessage serializer = MiniMessage.miniMessage();
return serializer.deserialize(set(player, serializer.serialize(component))); return serializer.deserialize(set(player, serializer.serialize(component)));
} }
} }