Skip to content

Commit

Permalink
Add an option to keep sprinting while stationary
Browse files Browse the repository at this point in the history
  • Loading branch information
Wide-Cat committed Jan 1, 2025
1 parent 963b3f1 commit eb93d23
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ public enum Mode {
.build()
);

private final Setting<Boolean> permaSprint = sgGeneral.add(new BoolSetting.Builder()
.name("sprint-while-stationary")
.description("Sprint even when not moving.")
.defaultValue(false)
.visible(() -> mode.get() == Mode.Rage)
.build()
);

public Sprint() {
super(Categories.Movement, "sprint", "Automatically sprints.");
}
Expand Down Expand Up @@ -98,7 +106,9 @@ public boolean shouldSprint() {
? (Math.abs(mc.player.input.movementForward) + Math.abs(mc.player.input.movementSideways))
: mc.player.input.movementForward;

if (movement <= (mc.player.isSubmergedInWater() ? 1.0E-5F : 0.8)) return false;
if (movement <= (mc.player.isSubmergedInWater() ? 1.0E-5F : 0.8)) {
if (mode.get() == Mode.Strict || !permaSprint.get()) return false;
}

boolean strictSprint = !(mc.player.isTouchingWater() && !mc.player.isSubmergedInWater())
&& ((ClientPlayerEntityAccessor) mc.player).invokeCanSprint()
Expand Down

0 comments on commit eb93d23

Please sign in to comment.