|
5 | 5 |
|
6 | 6 | package meteordevelopment.meteorclient.mixin; |
7 | 7 |
|
| 8 | +import com.llamalad7.mixinextras.sugar.Local; |
8 | 9 | import meteordevelopment.meteorclient.systems.modules.Modules; |
9 | 10 | import meteordevelopment.meteorclient.systems.modules.movement.NoSlow; |
10 | | -import net.minecraft.block.BlockState; |
11 | 11 | import net.minecraft.block.SweetBerryBushBlock; |
12 | 12 | import net.minecraft.entity.Entity; |
13 | | -import net.minecraft.entity.EntityCollisionHandler; |
14 | | -import net.minecraft.util.math.BlockPos; |
15 | | -import net.minecraft.world.World; |
16 | 13 | import org.spongepowered.asm.mixin.Dynamic; |
17 | 14 | import org.spongepowered.asm.mixin.Mixin; |
18 | 15 | import org.spongepowered.asm.mixin.injection.At; |
|
23 | 20 |
|
24 | 21 | @Mixin(SweetBerryBushBlock.class) |
25 | 22 | public abstract class SweetBerryBushBlockMixin { |
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) |
27 | | - private void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity, EntityCollisionHandler handler, boolean bl, CallbackInfo ci) { |
28 | | - if (entity == mc.player && Modules.get().get(NoSlow.class).berryBush()) ci.cancel(); |
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) { |
| 23 | + @Dynamic("Explicit 1.21.9 Support") |
| 24 | + @Inject(method = { |
| 25 | + "onEntityCollision", // 1.21.10 |
| 26 | + "onEntityCollision(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/Entity;Lnet/minecraft/entity/EntityCollisionHandler;)V", // 1.21.9 yarn |
| 27 | + "method_9548(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1297;Lnet/minecraft/class_10774;)V" // 1.21.9 intermediary |
| 28 | + }, at = @At("HEAD"), cancellable = true) |
| 29 | + private void onEntityCollision(CallbackInfo ci, @Local(argsOnly = true) Entity entity) { |
34 | 30 | if (entity == mc.player && Modules.get().get(NoSlow.class).berryBush()) ci.cancel(); |
35 | 31 | } |
36 | 32 | } |
0 commit comments