The bug
In the End and the Nether the compass needle is supposed to spin randomly. In 1.8 it spun all the way around, but since then it only spins in the lower half of the compass and very rarely some pixels above.
How to reproduce
Open Minecraft 1.8 and enter the Nether with a compass in your hotbar
The needle spins all the way aroundOpen a newer version of Minecraft and enter the Nether with a compass in your hotbar
The needle spins only in the lower half
Fix is attached (fixes the wobble function by properly keeping the angle values in range)
Linked issues
is duplicated by 1
relates to 1
Attachments
Comments 10
Attached is a javascript demo of a possible fix for the compass, which also fixes MC-83905.
Code examples refer to (and the demo is based on) MCP 9.28.
It rewrites the ItemPropertyGetter in ItemCompass to bring it in line with the one in ItemClock (removing extra conversions to/from 2*PI), while keeping all the angle variables within range using MathHelper.positiveModulo.
Specifically, here, the needle is restricted to one side because the wobble function uses clamp_double to attempt to keep an angle variable in range, when MathHelper.positiveModulo would be more appropriate.
Still happens in 16w04a.