Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Fix for cant disable sprint scaffold issue #847 #850

Merged
merged 4 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added logo/logo_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 12 additions & 1 deletion src/main/java/keystrokesmod/module/impl/movement/Sprint.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import keystrokesmod.event.SprintEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.ModeSetting;
import keystrokesmod.module.setting.utils.ModeOnly;
import keystrokesmod.utility.MoveUtil;
Expand All @@ -16,12 +17,15 @@
public class Sprint extends Module {
private final ModeSetting mode = new ModeSetting("Mode", new String[]{"Legit", "Omni"}, 0);
private final ModeSetting omniMode = new ModeSetting("Bypass mode", new String[]{"None", "Legit"}, 1, new ModeOnly(mode, 1));
private final ButtonSetting disableWhileScaffold;
public static boolean omni = false;
public static boolean stopSprint = false;

public Sprint() {
super("Sprint", Module.category.movement, 0);
this.registerSetting(mode, omniMode);
//Only needs to work in legit mode
this.registerSetting(disableWhileScaffold = new ButtonSetting("Disable While Scaffold", false, new ModeOnly(mode, 0)));
Kefpull marked this conversation as resolved.
Show resolved Hide resolved
}

public static boolean omni() {
Expand All @@ -42,7 +46,14 @@ public static boolean stopSprint() {
@SubscribeEvent
public void p(PlayerTickEvent e) {
if (Utils.nullCheck() && mc.inGameHasFocus) {
KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(), true);

if(ModuleManager.scaffold.isEnabled() && disableWhileScaffold.isToggled()) {
KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(), false);
}
else {
KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(), true);
}

TejasLamba2006 marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
10 changes: 9 additions & 1 deletion src/main/java/keystrokesmod/module/impl/world/Scaffold.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public class Scaffold extends IAutoClicker {
private final ButtonSetting polar;
private final ButtonSetting postPlace;
private final ButtonSetting lookView;
private final ButtonSetting cancelSprintAtStart;

public @Nullable MovingObjectPosition rayCasted = null;
public MovingObjectPosition placeBlock;
Expand Down Expand Up @@ -196,6 +197,7 @@ public Scaffold() {
this.registerSetting(polar = new ButtonSetting("Polar", false, expand::isToggled));
this.registerSetting(postPlace = new ButtonSetting("Post place", false, "Place on PostUpdate."));
this.registerSetting(lookView = new ButtonSetting("Look view", false));
this.registerSetting(cancelSprintAtStart = new ButtonSetting("Cancel sprint at start", false));
xia-mc marked this conversation as resolved.
Show resolved Hide resolved
}

public void onDisable() {
Expand Down Expand Up @@ -241,8 +243,14 @@ public void onEnable() {
hoverState = HoverState.DONE;
}

if (stopAtStart.isToggled())
if (stopAtStart.isToggled()) {
stopMoving = true;
}

if (cancelSprintAtStart.isToggled()) {
mc.thePlayer.setSprinting(false);
}

}

@SubscribeEvent
Expand Down
Loading