mojira.dev
MC-88103

Clock animates incorrectly / spins at noon (fix included)

Possible fix is attached.

Description and steps to reproduce:

At noon (time 6000), the clock spins once, under certain conditions.

Slow way, no /time commands

  1. Start a world, /give yourself a clock.

  2. Allow 5 minutes to pass, without advancing /time.

  3. You won't see the clock spin at the first noon.

  4. Allow 20 more minutes to pass, without advancing /time.

  5. The clock will spin around at any noontime after the first noon.

Faster way

  1. Start a world, /give yourself a clock,

  2. /time set noon

    • I reproduced this most reliably when I started near noontime. I couldn't tell you how near to noon is close enough to trigger this 100%, but setting to noon definitely works.

  3. Close out of Minecraft entirely, relaunch, and open that world again.

  4. /time set 5900

    • .. or any full day after: 29900, 53900, etc

    • it spins to get to this time, but this is not the bug.

  5. The clock will spin around at noontime.

If you play around and issue too many /time commands, such as /time set day, the spinning at noon can stop happening – unless you relaunch Minecraft, then you can make it happen again.

Wasn't happening in 1.8.8, but started happening in the first 1.9 snapshots.

Possibly related to MC-83905 where the compass spins when the player faces south.

Linked issues

Attachments

Comments 15

Thanks Grum! Any chance the compass, MC-83905, is a similar fix? EDIT: Thanks for taking time on a Sunday afternoon!

Sorry Grum, it still spins at noon.

Cannot reproduce clock spinning at noon in SP, are you playing in MP?

I can't seem to reproduce this issue, are you sure it's still an issue?

5 more comments

Users can hide most of the list by clicking on the three small arrows at the end of the list if they don't want to see it, but having more complete affected version information helps us with tracking and searching for bugs. So it's best not to remove them.

The enviroment is supposed to contain pc details

Attached is a javascript demo of a possible fix for the clock.

Code examples refer to (and the demo is based on) MCP 9.28.

It keeps certain angle variables within range using MathHelper.positiveModulo.

Specifically, here, the clock flips as the time reaches noon 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.

Updated fix. Last fix was good, but contained bad line numbers in the directions.

Fixed in 16w36a. Now my soul can be at rest.

shufboyardee

Erik Broes

Confirmed

Minecraft 15w36d, Minecraft 15w37a, Minecraft 15w38a, Minecraft 15w40a, Minecraft 15w41b, ..., Minecraft 16w20a, Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w32b, Minecraft 16w33a

Minecraft 15w45a, Minecraft 16w36a

Retrieved