@@ -2,15 +2,14 @@ package com.github.yufiriamazenta.deathmsg.listener
22
33import com.github.yufiriamazenta.deathmsg.DEATH_MESSAGE
44import com.github.yufiriamazenta.deathmsg.data.DataManager
5- import com.github.yufiriamazenta.deathmsg.util.NmsUtil.getItemTagJson
65import crypticlib.CrypticLib
76import crypticlib.listener.BukkitListener
7+ import crypticlib.nms.item.ItemFactory
88import crypticlib.util.MsgUtil
99import crypticlib.util.TextUtil
1010import me.clip.placeholderapi.PlaceholderAPI
1111import net.md_5.bungee.api.ChatMessageType
1212import net.md_5.bungee.api.chat.*
13- import net.md_5.bungee.api.chat.hover.content.Item
1413import net.minecraft.network.chat.ComponentContents
1514import net.minecraft.network.chat.IChatBaseComponent
1615import net.minecraft.network.chat.contents.TranslatableContents
@@ -294,15 +293,9 @@ class DeathHandler: Listener {
294293 }
295294 itemName = itemNameFormat.replace(" %item_name%" , itemName)
296295 itemName = TextUtil .color(itemName)
297- val tag = getItemTagJson(handItem)
298296 val itemDisplayCompound: BaseComponent = TextComponent ()
299- for (itemNameCompound in TextComponent .fromLegacyText(itemName)) {
300- itemNameCompound.hoverEvent = HoverEvent (
301- HoverEvent .Action .SHOW_ITEM ,
302- Item (handItem.type.getKey().toString(), handItem.amount, ItemTag .ofNbt(tag))
303- )
304- itemDisplayCompound.addExtra(itemNameCompound)
305- }
297+ itemDisplayCompound.extra = TextComponent .fromLegacyText(itemName).toMutableList()
298+ itemDisplayCompound.hoverEvent = ItemFactory .item(handItem).toHover();
306299 return itemDisplayCompound
307300 }
308301
0 commit comments