|
13 | 13 | import net.minecraft.entity.EntityCollisionHandler; |
14 | 14 | import net.minecraft.util.math.BlockPos; |
15 | 15 | import net.minecraft.world.World; |
| 16 | +import org.spongepowered.asm.mixin.Dynamic; |
16 | 17 | import org.spongepowered.asm.mixin.Mixin; |
17 | 18 | import org.spongepowered.asm.mixin.injection.At; |
18 | 19 | import org.spongepowered.asm.mixin.injection.Inject; |
|
22 | 23 |
|
23 | 24 | @Mixin(SweetBerryBushBlock.class) |
24 | 25 | public abstract class SweetBerryBushBlockMixin { |
25 | | - @Inject(method = "onEntityCollision", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;slowMovement(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Vec3d;)V"), cancellable = true) |
| 26 | + @Inject(method = "onEntityCollision", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;slowMovement(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Vec3d;)V"), cancellable = true, require = 0) |
26 | 27 | private void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity, EntityCollisionHandler handler, boolean bl, CallbackInfo ci) { |
27 | 28 | if (entity == mc.player && Modules.get().get(NoSlow.class).berryBush()) ci.cancel(); |
28 | 29 | } |
| 30 | + |
| 31 | + @Dynamic("1.21.9 Method Parameters") |
| 32 | + @Inject(method = "onEntityCollision", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;slowMovement(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Vec3d;)V"), cancellable = true, require = 0) |
| 33 | + private void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity, EntityCollisionHandler handler, CallbackInfo ci) { |
| 34 | + if (entity == mc.player && Modules.get().get(NoSlow.class).berryBush()) ci.cancel(); |
| 35 | + } |
29 | 36 | } |
0 commit comments