From 77e46173f7a22fd28c91d514b57ab46af4726479 Mon Sep 17 00:00:00 2001 From: garyantonyo Date: Mon, 2 Dec 2024 12:14:15 -0500 Subject: [PATCH] Fixes #671 The predicate now tests if objects in the inventory are the same item same tags instead of same object ref. --- .../hexcasting/common/casting/actions/spells/OpPlaceBlock.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/OpPlaceBlock.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/OpPlaceBlock.kt index e4d761452..d16e173a2 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/OpPlaceBlock.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/OpPlaceBlock.kt @@ -80,11 +80,11 @@ object OpPlaceBlock : SpellAction { UseOnContext(env.world, caster as? ServerPlayer, env.otherHand, spoofedStack, blockHit) val placeContext = BlockPlaceContext(itemUseCtx) if (bstate.canBeReplaced(placeContext)) { - if (env.withdrawItem({ it == placeeStack }, 1, false)) { + if (env.withdrawItem({ ItemStack.isSameItemSameTags(it, placeeStack) }, 1, false)) { val res = spoofedStack.useOn(placeContext) if (res != InteractionResult.FAIL) { - env.withdrawItem({ it == placeeStack }, 1, true) + env.withdrawItem({ ItemStack.isSameItemSameTags(it, placeeStack) }, 1, true) env.world.playSound( caster as? ServerPlayer,