Skip to content

Commit 7831a32

Browse files
committed
fix: (rotation) send silent yaw as a continuous offset so Grim's AimModulo360 sees no seam jump
1 parent e7ba43c commit 7831a32

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,12 @@ private void onUpdateWalkingPlayer(CallbackInfo ci) {
183183
final Rotation currentRotation = RotationUtils.INSTANCE.getCurrentRotation();
184184

185185
if (currentRotation != null) {
186-
yaw = currentRotation.getYaw();
187186
pitch = currentRotation.getPitch();
187+
// Vanilla sends a continuous, accumulating yaw; a silent rotation can carry a wrapped
188+
// [-180, 180] yaw whose packet delta jumps ~360 at the seam, which GrimAC's AimModulo360
189+
// flags. Re-express it as the shortest continuous offset from the last reported yaw so the
190+
// wire delta is always <= 180 and no seam jump is ever sent (both rotation engines).
191+
yaw = this.lastReportedYaw + MathHelper.wrapAngleTo180_float(currentRotation.getYaw() - this.lastReportedYaw);
188192
}
189193

190194
double xDiff = motionEvent.getX() - lastReportedPosX;

0 commit comments

Comments
 (0)