Skip to content

Commit 41efe48

Browse files
[1.2.6]删除NmsUtil,物品展示功能由CrypticLib提供
1 parent c02cb87 commit 41efe48

File tree

3 files changed

+5
-52
lines changed

3 files changed

+5
-52
lines changed

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
}
99

1010
group = "com.github.yufiriamazenta"
11-
version = "1.2.5"
11+
version = "1.2.6"
1212

1313
repositories {
1414
mavenLocal()
@@ -31,7 +31,7 @@ dependencies {
3131
compileOnly("org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT")
3232
compileOnly("net.luckperms:api:5.4")
3333
compileOnly("me.clip:placeholderapi:2.11.1")
34-
implementation("com.crypticlib:common:0.2.5")
34+
implementation("com.crypticlib:CrypticLib:0.3.6")
3535
implementation(kotlin("stdlib-jdk8"))
3636
}
3737

src/main/kotlin/com/github/yufiriamazenta/deathmsg/listener/DeathHandler.kt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ package com.github.yufiriamazenta.deathmsg.listener
22

33
import com.github.yufiriamazenta.deathmsg.DEATH_MESSAGE
44
import com.github.yufiriamazenta.deathmsg.data.DataManager
5-
import com.github.yufiriamazenta.deathmsg.util.NmsUtil.getItemTagJson
65
import crypticlib.CrypticLib
76
import crypticlib.listener.BukkitListener
7+
import crypticlib.nms.item.ItemFactory
88
import crypticlib.util.MsgUtil
99
import crypticlib.util.TextUtil
1010
import me.clip.placeholderapi.PlaceholderAPI
1111
import net.md_5.bungee.api.ChatMessageType
1212
import net.md_5.bungee.api.chat.*
13-
import net.md_5.bungee.api.chat.hover.content.Item
1413
import net.minecraft.network.chat.ComponentContents
1514
import net.minecraft.network.chat.IChatBaseComponent
1615
import 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

src/main/kotlin/com/github/yufiriamazenta/deathmsg/util/NmsUtil.kt

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)