mojira.dev
MC-51150

Swimming in water, riding a minecart or standing on soul sand and snow layers 8 darkens the sky at day time

The bug

In some situations the sky darkens when it shouldn't.

Affected situations

Likely incomplete

  • Sitting in a minecart or boat

  • Swimming in water

  • Standing on soul sand and snow layers 8

Code analysis and possible fix

The bug was introduced in 1.8 (according to the bug report comments) where they changed the client to track entities by their feet location instead of their eye location. This bug fix does the sky light calculation (for determining fog color) at the entity's eye location where it should be instead of their feet.

Source

Forge code changes

float f3 = this.mc.world.getLightBrightness(new BlockPos(this.mc.getRenderViewEntity()));

Linked issues

MC-48871 When I go on soul sand, 1) the sky turns dark. 2) my hand also turns dark Resolved MC-49130 Sky and held Items become darker when sitting in a minecart. Resolved MC-49457 Sky darkens when standing on Soul Sand or in water Resolved MC-50960 When In a Minecart The Sky light diminishes. Resolved MC-54111 MInecart & Sky texture bug Resolved

Attachments

Comments 26

Reopening this, because the part "Held Items darken in Minecart" of MC-47591 is fixed.

When in a Minecart, the sky only darkens on a flat track. It's normal on an incline. (And it alternates between and light when on a track that alternates between flat and inclined tracks.)

I think that this is due to the light levels being calculated from the feet instead of from your head (combined with the bug where you sit too low in Minecarts).

And light levels are being calculated from your feet instead of your head because of a bug fix in an early 1.8 snapshot.

Before the fix, the client referenced entities by eye position rather than feet position (the real coordinates). Now it uses the feet position, like the server does.

The sky darkening is dependent on the light level at the player's position. Since it now reads the position from the feet, it reads the light level at the feet, even when the player's eyes have a different light level.

What would fix this is to make the sky darkening read the light level from the eyes, separate from the other client functions that use player position.

Related to MC-31681.

16 more comments

Can confirm for MC 1.12.1.

BillyGalbreath

Confirmed for 1.12.2 and 17w43b. I found the root cause and sent a PR fix to the Forge project.

Seems to me that it's partially fixed in 18w22c: Sitting in a Minecart and bobbing up and down in water doesn't make the sky turn dark anymore. Standing on soul sand and snow layer 8 does turn the sky dark, still.

 

I can't recreate the Bug in 1.13.1-pre2 at all. All 4 Situations don't darken the sky at all.

According to @unknown this was fixed in pre1.

Brian Tyler

(Unassigned)

Confirmed

Minecraft 14w11b, Minecraft 14w34d, Minecraft 1.8, Minecraft 1.8.1-pre4, Minecraft 1.8.1, ..., Minecraft 18w06a, Minecraft 18w07a, Minecraft 1.13-pre1, Minecraft 1.13, Minecraft 18w30b

Minecraft 1.13.1-pre1

Retrieved