Skip to content

Commit 27d2848

Browse files
author
Kenzo101 Studios
committed
RELEASE!
1 parent f168cfd commit 27d2848

20 files changed

Lines changed: 162 additions & 6 deletions

common/src/main/java/com/wurstclient_v7/gui/ModuleScreen.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ public void render(GuiGraphics gfx, int mouseX, int mouseY, float partialTick) {
8484
renderModule(gfx, x, lineY, "andromeda", AndromedaBridge.isEnabled(), "andromeda_toggle");
8585
lineY += 12;
8686

87+
88+
renderModule(gfx, x, lineY, "safewalk", com.wurstclient_v7.feature.SafeWalk.isEnabled(), "safewalk_toggle");
89+
lineY += 12;
90+
8791
super.render(gfx, mouseX, mouseY, partialTick);
8892
}
8993

@@ -246,6 +250,12 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) {
246250
return true;
247251
}
248252

253+
// 1. Add SafeWalk Click handling
254+
if (checkClick(mouseX, mouseY, x, lineY)) {
255+
com.wurstclient_v7.feature.SafeWalk.toggle();
256+
return true;
257+
}
258+
249259
return super.mouseClicked(mouseX, mouseY, button);
250260
}
251261

common/src/main/java/com/wurstclient_v7/mixin/ClientTickMixin.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class ClientTickMixin {
2828
private static boolean prevESPPressed = false;
2929
private static boolean prevTracersPressed = false;
3030
private static boolean prevAndromedaPressed = false;
31+
private static boolean prevSafeWalkPressed = false;
3132

3233
@Inject(method = "tick", at = @At("TAIL"))
3334
private void onTick(CallbackInfo ci) {
@@ -166,6 +167,12 @@ private void onTick(CallbackInfo ci) {
166167
}
167168
prevAndromedaPressed = andromedaPressed;
168169

170+
boolean swPressed = KeybindManager.isPressed(window, "safewalk_toggle");
171+
if (swPressed && !prevSafeWalkPressed) {
172+
com.wurstclient_v7.feature.SafeWalk.toggle();
173+
}
174+
prevSafeWalkPressed = swPressed;
175+
169176
// Mouse left click handling (for autoattack)
170177
boolean leftPressed = InputConstants.isKeyDown(window, org.lwjgl.glfw.GLFW.GLFW_MOUSE_BUTTON_LEFT);
171178
if (leftPressed && !prevLeftPressed) {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.wurstclient_v7.mixin;
2+
3+
import com.wurstclient_v7.feature.SafeWalk;
4+
import net.minecraft.world.entity.Entity;
5+
import net.minecraft.world.entity.player.Player;
6+
import org.spongepowered.asm.mixin.Mixin;
7+
import org.spongepowered.asm.mixin.injection.At;
8+
import org.spongepowered.asm.mixin.injection.Inject;
9+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
10+
11+
@Mixin(Entity.class)
12+
public abstract class SafeWalkMixin {
13+
14+
// In 1.21.1, the method name is usually 'isSteppingCarefully'
15+
// but if that fails, we target the logic that checks for sneaking/ledges
16+
@Inject(method = "isSteppingCarefully", at = @At("HEAD"), cancellable = true)
17+
private void onIsSteppingCarefully(CallbackInfoReturnable<Boolean> cir) {
18+
// We only want this to apply to the PLAYER, not every mob in the world!
19+
if ((Object) this instanceof Player) {
20+
if (SafeWalk.isEnabled()) {
21+
cir.setReturnValue(true);
22+
}
23+
}
24+
}
25+
}

common/src/main/resources/wurst_client_on_neoforge.mixins.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
"InGameHudMixin",
88
"ClientTickMixin",
99
"EntityMixin",
10+
"SafeWalkMixin",
1011
"XRayMixin"
1112
],
13+
"refmap": "wurst_client_on_neoforge.refmap.json",
1214
"mixins": [],
1315
"injectors": {
1416
"defaultRequire": 1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)