Skip to content

Commit 1b5407f

Browse files
committed
fix: (sprint) drop sprint when a silent rotation diverges from movement
GrimAC's prediction only allows sprint whose movement resolves to forward=1 in the frame of the yaw sent to the server (movement within ~45 deg of the sent yaw). Scaffold/KillAura silent rotations that point off the movement direction while sprinting made every tick unpredictable and flagged. Feed the sprint controller the server-rotation-frame input again (as older builds did) and add an AntiCheatSprint guard (default on) that stops sprint whenever a server-side rotation is active and the server-frame forward drops below 1, overriding AllDirections and scaffold-controlled sprint.
1 parent 75de5ec commit 1b5407f

2 files changed

Lines changed: 18 additions & 8 deletions

File tree

src/main/java/net/ccbluex/liquidbounce/features/module/modules/movement/Sprint.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ object Sprint : Module("Sprint", Category.MOVEMENT, Category.SubCategory.MOVEMEN
6060
private val noPackets by boolean("NoPackets", false) { mode == "Vanilla" }
6161
.describe("Do not send sprint start/stop packets.")
6262

63+
private val anticheatSprint by boolean("AntiCheatSprint", true)
64+
.describe("Stop sprinting when a silent rotation points more than ~45 degrees off your movement; modern anticheats reject sprinting off the yaw sent to the server.")
65+
6366
private var isSprinting = false
6467

6568
private val generalGroup = Configurable("General")
@@ -68,7 +71,7 @@ object Sprint : Module("Sprint", Category.MOVEMENT, Category.SubCategory.MOVEMEN
6871
private val serverSideGroup = Configurable("ServerSide")
6972

7073
init {
71-
moveValues(generalGroup, "Mode", "OnlyOnSprintPress", "AlwaysCorrectSprint", "NoPackets")
74+
moveValues(generalGroup, "Mode", "OnlyOnSprintPress", "AlwaysCorrectSprint", "NoPackets", "AntiCheatSprint")
7275
moveValues(directionsGroup,
7376
"AllDirections", "JumpDirections", "AllDirectionsLimitSpeed", "AllDirectionsLimitSpeedOnlyGround")
7477
moveValues(conditionsGroup, "Blindness", "UsingItem", "Inventory", "Food")
@@ -179,6 +182,16 @@ object Sprint : Module("Sprint", Category.MOVEMENT, Category.SubCategory.MOVEMEN
179182
return true
180183
}
181184

185+
// GrimAC's prediction only accepts sprint whose movement resolves to forward = 1 in the
186+
// frame of the yaw we send. When a silent server-side rotation points more than ~45 degrees
187+
// off our real movement, the server-frame forward drops below 1, so keeping sprint desyncs
188+
// every tick. Drop sprint here regardless of AllDirections or scaffold-controlled sprint.
189+
val silentRotationRejectsSprint = currentRotation != null &&
190+
activeSettings?.applyServerSide == true && modifiedForward < 0.8f
191+
if (anticheatSprint && silentRotationRejectsSprint) {
192+
return true
193+
}
194+
182195
if (ignoreDirectionCheck) {
183196
return false
184197
}

src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/entity/MixinEntityPlayerSP.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -424,13 +424,10 @@ public void onLivingUpdate() {
424424

425425
EventManager.INSTANCE.call(PostSprintUpdateEvent.INSTANCE);
426426

427-
final boolean modernSilentCorrection = settings != null && settings.getUseModernRotations()
428-
&& ("Strict".equals(settings.getModernMovementCorrection())
429-
|| "Silent".equals(settings.getModernMovementCorrection()));
430-
431-
// Silent rotation correction must not make the sprint controller interpret the remapped
432-
// server-side input as the player's physical direction.
433-
sprint.correctSprintState(modernSilentCorrection ? movementInput : modifiedInput, isUsingItem);
427+
// Feed the sprint controller the movement expressed in the server-rotation frame
428+
// (modifiedInput). GrimAC only accepts sprint within ~45 degrees of the yaw we send, so the
429+
// direction guard in Sprint must evaluate the server-frame forward, not the raw camera input.
430+
sprint.correctSprintState(modifiedInput, isUsingItem);
434431

435432
if (capabilities.allowFlying) {
436433
if (mc.playerController.isSpectatorMode()) {

0 commit comments

Comments
 (0)