Skip to content

Commit 02791bb

Browse files
authored
Fix placeblock not pulling items from inventory when they are available. (#812)
2 parents 196e4dd + 77e4617 commit 02791bb

File tree

1 file changed

+2
-2
lines changed
  • Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells

1 file changed

+2
-2
lines changed

Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/OpPlaceBlock.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ object OpPlaceBlock : SpellAction {
8080
UseOnContext(env.world, caster as? ServerPlayer, env.otherHand, spoofedStack, blockHit)
8181
val placeContext = BlockPlaceContext(itemUseCtx)
8282
if (bstate.canBeReplaced(placeContext)) {
83-
if (env.withdrawItem({ it == placeeStack }, 1, false)) {
83+
if (env.withdrawItem({ ItemStack.isSameItemSameTags(it, placeeStack) }, 1, false)) {
8484
val res = spoofedStack.useOn(placeContext)
8585

8686
if (res != InteractionResult.FAIL) {
87-
env.withdrawItem({ it == placeeStack }, 1, true)
87+
env.withdrawItem({ ItemStack.isSameItemSameTags(it, placeeStack) }, 1, true)
8888

8989
env.world.playSound(
9090
caster as? ServerPlayer,

0 commit comments

Comments
 (0)