Skip to content

Commit

Permalink
Fix placeblock not pulling items from inventory when they are availab…
Browse files Browse the repository at this point in the history
…le. (#812)
  • Loading branch information
gamma-delta authored Jan 14, 2025
2 parents 196e4dd + 77e4617 commit 02791bb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 02791bb

Please sign in to comment.