diff --git a/module/module-nms-util-tag-legacy/src/main/kotlin/taboolib/module/nms/NMSItemTag.kt b/module/module-nms-util-tag-legacy/src/main/kotlin/taboolib/module/nms/NMSItemTag.kt index e2bcf01e9..6b90ed851 100644 --- a/module/module-nms-util-tag-legacy/src/main/kotlin/taboolib/module/nms/NMSItemTag.kt +++ b/module/module-nms-util-tag-legacy/src/main/kotlin/taboolib/module/nms/NMSItemTag.kt @@ -22,8 +22,9 @@ open class NMSItemTagImpl1 : NMSItemTag() { val nbtTagStringGetter = unreflectGetter(if (MinecraftVersion.isUniversal) "A" else "data") val nbtTagByteArrayGetter = unreflectGetter(if (MinecraftVersion.isUniversal) "c" else "data") val nbtTagIntArrayGetter = unreflectGetter(if (MinecraftVersion.isUniversal) "c" else "data") - val nbtTagLongArrayGetter = unreflectGetter(if (MinecraftVersion.isUniversal) "c" else "b") - + val nbtTagLongArrayGetter = + if (!MinecraftVersion.isHigherOrEqual(MinecraftVersion.V1_12)) null + else unreflectGetter(if (MinecraftVersion.isUniversal) "c" else "b") private fun getNMSCopy(itemStack: ItemStack): NMSItemStack12 { return org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack.asNMSCopy(itemStack) } @@ -108,7 +109,7 @@ open class NMSItemTagImpl1 : NMSItemTag() { // 数组类型特殊处理 is NBTTagByteArray12 -> ItemTagData(ItemTagType.BYTE_ARRAY, nbtTagByteArrayGetter.get(nbtTag).copyOf()) is NBTTagIntArray12 -> ItemTagData(ItemTagType.INT_ARRAY, nbtTagIntArrayGetter.get(nbtTag).copyOf()) - is NBTTagLongArray12 -> ItemTagData(ItemTagType.LONG_ARRAY, nbtTagLongArrayGetter.get(nbtTag).copyOf()) + is NBTTagLongArray12 -> ItemTagData(ItemTagType.LONG_ARRAY, nbtTagLongArrayGetter!!.get(nbtTag).copyOf()) // 列表类型特殊处理 is NBTTagList12 -> {