From 914b44069bd7e2a47adcfd477d8b86b85b319531 Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Mon, 17 Aug 2020 15:22:41 +0200 Subject: [PATCH] Convert item display name --- .../java/com/plotsquared/bukkit/util/BukkitInventoryUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitInventoryUtil.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitInventoryUtil.java index a849f16b5..b50e370cd 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitInventoryUtil.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitInventoryUtil.java @@ -32,6 +32,7 @@ import com.plotsquared.core.plot.PlotInventory; import com.plotsquared.core.plot.PlotItemStack; import com.plotsquared.core.util.InventoryUtil; import com.sk89q.worldedit.bukkit.BukkitAdapter; +import net.kyori.adventure.text.Component; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -88,7 +89,8 @@ import java.util.stream.IntStream; ItemMeta meta = null; if (item.getName() != null) { meta = stack.getItemMeta(); - meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', item.getName())); + Component nameComponent = BukkitUtil.MINI_MESSAGE.parse(item.getName()); + meta.setDisplayName(BukkitUtil.LEGACY_COMPONENT_SERIALIZER.serialize(nameComponent)); } if (item.getLore() != null) { if (meta == null) {