Instead of the needle moving naturally to the proper position, the compass loops backwards all the way around to the correct position.
This happens on two different occasions:
when you are turning around and you face south,
when you move between the +X,+Z and +X,-Z quadrants.
A fix is attached, which keeps the angle's local variable in range, rather than just keeping certain return values in range.
Linked issues
is duplicated by 4
relates to 1
Attachments
Comments 28
Confirmed. See http://gfycat.com/UnknownInsignificantBobwhite
Confirmed. Happens when passing the direction of the forward z axis.
Duplicated by MC-84596.
Still in 15w36c. Probably should update the description to read "when player faces south" and not "when needle is pointing downward"
Attached is a javascript demo of a possible fix for the compass, which also fixes MC-95460.
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 flips as the player rotates / moves because the this.rotation is not being kept in range; the fix here is to apply MathHelper.positiveModulo to this.rotation after updating this.rotation, within the wobble function, rather than simply applying positiveModulo on the returned value of the wobble function.
confirmed