Skip to content

Commit

Permalink
fix #750
Browse files Browse the repository at this point in the history
  • Loading branch information
gamma-delta committed Nov 19, 2024
1 parent d0ac296 commit 2428d83
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ object OpPlaceBlock : SpellAction {
get() = 1

override fun execute(
args: List<Iota>,
env: CastingEnvironment
args: List<Iota>,
env: CastingEnvironment
): SpellAction.Result {
val pos = args.getBlockPos(0, argc)
env.assertPosInRangeForEditing(pos)
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 2428d83

Please sign in to comment.