mojira.dev
MC-4020

Rotation of beacon beams are serverside

This lags the turning of beacon beams. I'm almost certain it's server-side, since the rotation lags when I go into big servers.
THIS IS NOT A DUPLICATE OF MC-2072 OR LIKEWISE POSTS, for it's a more compound explanation of the bug.

Related issues

Comments

Tails

If you can recreate this on an unmodded server, I can reopen.

This ticket is invalid as it relates to a modded or 3rd party client/server.

  • Any non-standard client/server build needs to be taken up with the appropriate team, not Mojang.

  • Any plugin issues need to be addressed to the plugin creator.

  • This site is for addressing issues related to the base unmodded MineCraft.

score

Tails, please re-open this issue.
By my calculations, this should start happening noticeably after the map has been online for around 45 days. It will also affect single-player worlds if you really have no life.
To reproduce this, see my CraftBukkit pull request: https://github.com/Bukkit/CraftBukkit/pull/1104#issuecomment-15567567

This is a real issue, caused by a clientside rounding error when the world uptime is cast to float.

Edit: "I'm almost certain it's serverside" - the description of the bug is guesswork, the real cause is the server sending a world time that is large, and because of how floating-point ( https://en.wikipedia.org/wiki/Single-precision_floating-point_format ) calculations are made, adding a tiny number (rotation amount) to a huge number (world uptime) tends to round down so far that it has literally no effect on the resulting number whatsoever. For an example of this, if you store the number 10000000000000000 as a single-precision floating point number, it rounds to 10000000272564224. Try to add 1000000 to this? The result is 10000000272564224, which is exactly the same as what we started with.

If the rounding error is fixed in the client (the fix I propose to craftbukkit is a hack to avoid the rounding error entirely, and is not the "real" fix), then beacons will rotate properly again. A cast to double would fix* this but that's cheating IMHO. The best solution would probably be to add the amount of ticks elapsed since last check to a tick counter (as float or double), instead of using the total world time, and then if it exceeds k (where k = 2pi / 1.5 / 0.025, determined from Minecraft's code as the rotation period of a beacon beam in ticks) subtract k from it. Saying that, since beacons have rotational symmetry every 90 degrees you could probably get away with k/4, but since there's very little granularity with numbers that small anyway, saving 2 mantissa bits won't really net you much benefit.

*Casting to double as the solution would mean it still suffers rounding errors, it'd just take much longer until it happens.

Tails

Duplicate of MC-1279.

Robert Tulley

(Unassigned)

Unconfirmed

Minecraft 1.4.4, Minecraft 1.4.5

Retrieved