From 6892bb41186af74dde29fa87cebbc3c91dad3d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=99=BD?= <3104026189@qq.com> Date: Sun, 2 Oct 2022 13:50:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DIA=E7=89=A9=E5=93=81=E5=87=BA?= =?UTF-8?q?=E5=94=AEBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 2 +- .../xbaimiao/shoppro/core/item/impl/ItemsAdderShopItem.kt | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index c89124a..ffc8aba 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ group=com.github.xbaimiao.shoppro -version=1.0.6-beta +version=1.0.6 diff --git a/src/main/kotlin/com/github/xbaimiao/shoppro/core/item/impl/ItemsAdderShopItem.kt b/src/main/kotlin/com/github/xbaimiao/shoppro/core/item/impl/ItemsAdderShopItem.kt index 73e13a1..aed73a9 100644 --- a/src/main/kotlin/com/github/xbaimiao/shoppro/core/item/impl/ItemsAdderShopItem.kt +++ b/src/main/kotlin/com/github/xbaimiao/shoppro/core/item/impl/ItemsAdderShopItem.kt @@ -36,7 +36,10 @@ class ItemsAdderShopItem( } override fun equal(itemStack: ItemStack): Boolean { - return itemStack.type == material && itemStack.itemMeta?.customModelData == custom + if (itemStack.hasItemMeta() && itemStack.itemMeta!!.hasCustomModelData()) { + return itemStack.type == material && itemStack.itemMeta?.customModelData == custom + } + return false } override fun vanillaItem(): ItemStack {