Skip to content

Commit d7c373c

Browse files
committed
修复高版本 ItemTag 写入
1 parent a5d5e67 commit d7c373c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • module/bukkit-nms/bukkit-nms-tag/bukkit-nms-tag-modern/src/main/kotlin/taboolib/module/nms

module/bukkit-nms/bukkit-nms-tag/bukkit-nms-tag-modern/src/main/kotlin/taboolib/module/nms/NMSItemTagImpl.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ class NMSItemTagImpl : NMSItemTag() {
7272
val nmsItem = getNMSCopy(itemStack)
7373
return if (onlyCustom) {
7474
val tag = nmsItem.get(DataComponents.CUSTOM_DATA)?.copyTag()
75-
if (tag != null) itemTagToBukkitCopy(tag).asCompound() else ItemTag()
75+
if (tag != null) itemTagToBukkitCopy(tag, true).asCompound() else ItemTag()
7676
} else {
7777
val tag = if (versionId >= 12106) nmsItem.toNbt() else nmsItem.save(CraftRegistry.getMinecraftRegistry())
78-
if (tag != null) itemTagToBukkitCopy(tag, true).asCompound() else ItemTag12005() // 返回一个特殊的 ItemTag
78+
if (tag != null) itemTagToBukkitCopy(tag, false).asCompound() else ItemTag12005() // 返回一个特殊的 ItemTag
7979
}
8080
}
8181

0 commit comments

Comments
 (0)