Skip to content

Commit 6b9c893

Browse files
committed
fix: (rotation) unwrap the silent yaw at the packet choke point so AimModulo360 sees no seam jump
The mixin-level continuous-offset attempt is undone by onPacket, which rewrites every outgoing rotating packet as packet.rotation = currentRotation (the engine may hold a wrapped [-180,180] yaw). Grim then sees a ~360 seam jump and flags AimModulo360. Apply the unwrap here, the single send choke point for both the Modern and Legacy engines: send the yaw as the shortest continuous offset from the last yaw the server received (serverRotation + angleDifference), so the packet delta is always <= 180 and never a seam jump.
1 parent 7831a32 commit 6b9c893

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/main/java/net/ccbluex/liquidbounce/utils/rotation/RotationUtils.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,12 @@ object RotationUtils : MinecraftInstance, Listenable {
967967
}
968968

969969
currentRotation?.let {
970-
packet.rotation = it
970+
// Send the yaw as the shortest continuous offset from the last yaw the server received, so
971+
// the packet delta is always <= 180 and never a ~360 seam jump (GrimAC AimModulo360). The
972+
// engine may carry a wrapped [-180, 180] yaw internally; the wire must stay continuous like
973+
// vanilla's accumulating yaw. This is the single choke point for both rotation engines.
974+
val continuousYaw = serverRotation.yaw + angleDifferences(it, serverRotation).x
975+
packet.rotation = Rotation(continuousYaw, it.pitch)
971976
// The network tail hook releases post-move actions only after this packet actually sends.
972977
PostRotationExecutor.markRotationPacket(packet)
973978
}

0 commit comments

Comments
 (0)