Skip to content

Commit

Permalink
Fixes #671
Browse files Browse the repository at this point in the history
The predicate now tests if objects in the inventory are the same item same tags instead of same object ref.
  • Loading branch information
garyyo committed Dec 2, 2024
1 parent 4da33f5 commit 77e4617
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 77e4617

Please sign in to comment.