mojira.dev
MC-95460

Compass needle spins only in lower half randomly in the End and Nether

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

  1. Open Minecraft 1.8 and enter the Nether with a compass in your hotbar
    The needle spins all the way around

  2. Open 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

Attachments

Comments 10

Still happens in 16w04a.

Still happens in 16w07a.

Affects 1.9 Pre-release 1.

Affects 1.9.1 Pre-release 1.

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.

Why isn't that issue community consensus?

Can confirm as well, if that helps...

marcono1234

Erik Broes

Confirmed

compass, end, needle, nether, random

Minecraft 15w51b, Minecraft 16w02a, Minecraft 16w03a, Minecraft 16w04a, Minecraft 16w07a, ..., Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a

Minecraft 16w36a

Retrieved