Skip to content

Commit 61f00b0

Browse files
committed
Reach module
1 parent 93017e0 commit 61f00b0

3 files changed

Lines changed: 47 additions & 0 deletions

File tree

src/main/java/com/lambda/mixin/entity/PlayerEntityMixin.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import com.lambda.event.EventFlow;
2222
import com.lambda.event.events.MovementEvent;
2323
import com.lambda.interaction.managers.rotating.RotationManager;
24+
import com.lambda.module.modules.player.Reach;
25+
import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod;
2426
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
2527
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
2628
import net.minecraft.entity.player.PlayerEntity;
@@ -46,4 +48,18 @@ private float wrapHeadYaw(PlayerEntity instance, Operation<Float> original) {
4648
Float yaw = RotationManager.getHeadYaw();
4749
return (yaw != null) ? yaw : original.call(instance);
4850
}
51+
52+
@SuppressWarnings("RedundantCast")
53+
@WrapMethod(method = "getBlockInteractionRange")
54+
private double wrapGetBlockInteractionRange(Operation<Double> original) {
55+
if ((PlayerEntity) (Object) this == Lambda.getMc().player && Reach.INSTANCE.isEnabled()) return Reach.getBlockReach();
56+
return original.call();
57+
}
58+
59+
@SuppressWarnings("RedundantCast")
60+
@WrapMethod(method = "getEntityInteractionRange")
61+
private double wrapGetEntityInteractionRange(Operation<Double> original) {
62+
if ((PlayerEntity) (Object) this == Lambda.getMc().player && Reach.INSTANCE.isEnabled()) return Reach.getEntityReach();
63+
return original.call();
64+
}
4965
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2026 Lambda
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
package com.lambda.module.modules.player
19+
20+
import com.lambda.module.Module
21+
import com.lambda.module.tag.ModuleTag
22+
23+
object Reach : Module(
24+
name = "Reach",
25+
description = "Changes the reach distance of the player",
26+
tag = ModuleTag.PLAYER
27+
) {
28+
@JvmStatic val blockReach by setting("Block Reach", 4.5, 0.0..10.0, 0.01)
29+
@JvmStatic val entityReach by setting("Entity Reach", 3.0, 0.0..10.0, 0.01)
30+
}

src/main/kotlin/com/lambda/module/modules/world/Printer.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ object Printer : Module(
106106
}
107107

108108
immediateRenderer("Printer Immediate Renderer", { reachCircleDepthTest }) {
109+
if (!reachCircle) return@immediateRenderer
109110
val player = mc.player ?: return@immediateRenderer
110111
val playerPos = lerp(mc.tickDelta, player.prevPos, player.pos)
111112
val circleY = playerPos.y + reachCircleHeight

0 commit comments

Comments
 (0)