mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 14:46:45 +01:00
Convert item display name
This commit is contained in:
parent
4789327378
commit
914b44069b
@ -32,6 +32,7 @@ import com.plotsquared.core.plot.PlotInventory;
|
|||||||
import com.plotsquared.core.plot.PlotItemStack;
|
import com.plotsquared.core.plot.PlotItemStack;
|
||||||
import com.plotsquared.core.util.InventoryUtil;
|
import com.plotsquared.core.util.InventoryUtil;
|
||||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -88,7 +89,8 @@ import java.util.stream.IntStream;
|
|||||||
ItemMeta meta = null;
|
ItemMeta meta = null;
|
||||||
if (item.getName() != null) {
|
if (item.getName() != null) {
|
||||||
meta = stack.getItemMeta();
|
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 (item.getLore() != null) {
|
||||||
if (meta == null) {
|
if (meta == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user