Mojira Archive
MC-278298

player flickers when flying with elytra

this is technically a duplicate of MC-142246, but that was closed as resolved, so I made this new one
when flying wit an elytra at higher speeds with fireworks, the player starts to flicker

this is caused by floating point inprecissions
inĀ 

net.minecraft.client.renderer.entity.player.PlayerRenderer#extractFlightData

in this part

if (d > 0.0 && d2 > 0.0) {
  playerRenderState.shouldApplyFlyingYRot = true;
  double d3 = (vec32.x * vec3.x + vec32.z * vec3.z) / Math.sqrt(d * d2);
  double d4 = vec32.x * vec3.z - vec32.z * vec3.x;
  playerRenderState.flyingYRot = (float)(Math.signum(d4) * Math.acos(d3));
} 

d3 can get sligthly above 1 (like 1.0000000000000002), which produces a NaN, because acos of >1 is NaN

Duplicate

Bayer Florian

2024-11-13, 04:57 PM

2024-11-13, 05:04 PM

2024-11-13, 04:59 PM

0

0

Unconfirmed

(Unassigned)

1.21.3

-