diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/PlayerEntityMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/PlayerEntityMixin.java index 745ced14c4..f94265009f 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/PlayerEntityMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/PlayerEntityMixin.java @@ -27,6 +27,7 @@ import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; +import net.minecraft.util.math.Box; import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -133,4 +134,19 @@ private double modifyBlockInteractionRange(double original) { private double modifyEntityInteractionRange(double original) { return Math.max(0, original + Modules.get().get(Reach.class).entityReach()); } + + @Inject(method = "canAttackEntityIn", at = @At("HEAD"), cancellable = true) + private void canReachAttackIn(Box box, double additionalRange, CallbackInfoReturnable cir) { + if (Modules.get().get(Reach.class).isActive()) cir.setReturnValue(true); + } + + @Inject(method = "canInteractWithEntityIn", at = @At("HEAD"), cancellable = true) + private void canReachEntityIn(Box box, double additionalRange, CallbackInfoReturnable cir) { + if (Modules.get().get(Reach.class).isActive()) cir.setReturnValue(true); + } + + @Inject(method = "canInteractWithBlockAt", at = @At("HEAD"), cancellable = true) + private void canReachBlock(BlockPos pos, double additionalRange, CallbackInfoReturnable cir) { + if (Modules.get().get(Reach.class).isActive()) cir.setReturnValue(true); + } }