From 2428d830a21f8dc3237908d7297188b4f182de72 Mon Sep 17 00:00:00 2001 From: gamma-delta Date: Tue, 19 Nov 2024 12:11:29 -0600 Subject: [PATCH] fix #750 --- .../common/casting/actions/spells/OpPlaceBlock.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 e71a3df9bd..e4d761452b 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 @@ -29,8 +29,8 @@ object OpPlaceBlock : SpellAction { get() = 1 override fun execute( - args: List, - env: CastingEnvironment + args: List, + env: CastingEnvironment ): SpellAction.Result { val pos = args.getBlockPos(0, argc) env.assertPosInRangeForEditing(pos) @@ -76,7 +76,8 @@ object OpPlaceBlock : SpellAction { // we temporarily give the player the stack, place it using mc code, then give them the old stack back. spoofedStack.count = 1 - val itemUseCtx = UseOnContext(env.world, caster as? ServerPlayer, env.castingHand, spoofedStack, blockHit) + val itemUseCtx = + 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)) {