|
26 | 26 |
|
27 | 27 | import com.google.common.collect.ImmutableList; |
28 | 28 | import com.llamalad7.mixinextras.injector.ModifyExpressionValue; |
| 29 | +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; |
| 30 | +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; |
29 | 31 | import com.llamalad7.mixinextras.sugar.Local; |
30 | 32 | import net.minecraft.commands.CommandSourceStack; |
31 | 33 | import net.minecraft.core.BlockPos; |
@@ -708,25 +710,24 @@ public void stopRiding() { |
708 | 710 | } |
709 | 711 | } |
710 | 712 |
|
711 | | - @Redirect( |
| 713 | + @WrapOperation( |
712 | 714 | method = "move", |
713 | 715 | at = @At( |
714 | 716 | value = "INVOKE", |
715 | 717 | target = "Lnet/minecraft/world/level/block/Block;stepOn(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/entity/Entity;)V" |
716 | 718 | ) |
717 | 719 | ) |
718 | | - private void impl$onStepOnCollide(final Block block, final Level world, final BlockPos pos, final BlockState state, final Entity entity) { |
| 720 | + private void impl$onStepOnCollide(final Block block, final Level world, final BlockPos pos, final BlockState state, final Entity entity, final Operation<Void> original) { |
719 | 721 | if (!ShouldFire.COLLIDE_BLOCK_EVENT_STEP_ON || world.isClientSide) { |
720 | | - block.stepOn(world, pos, state, entity); |
| 722 | + original.call(block, world, pos, state, entity); |
721 | 723 | return; |
722 | 724 | } |
723 | 725 |
|
724 | 726 | final org.spongepowered.api.util.Direction dir = org.spongepowered.api.util.Direction.NONE; |
725 | 727 | if (!SpongeCommonEventFactory.handleCollideBlockEvent(block, world, pos, state, entity, dir, SpongeCommonEventFactory.CollisionType.STEP_ON)) { |
726 | | - block.stepOn(world, pos, state, entity); |
| 728 | + original.call(block, world, pos, state, entity); |
727 | 729 | this.impl$lastCollidedBlockPos = pos; |
728 | 730 | } |
729 | | - |
730 | 731 | } |
731 | 732 |
|
732 | 733 | @Redirect(method = "checkInsideBlocks", |
|
0 commit comments