-
Bug
-
Resolution: Fixed
-
Minecraft 1.8.1, Minecraft 1.8.3, Minecraft 1.8.4, Minecraft 1.8.5, Minecraft 1.8.6, Minecraft 15w41b, Minecraft 15w42a, Minecraft 15w44a, Minecraft 15w45a, Minecraft 16w06a, Minecraft 16w07b, Minecraft 1.9 Pre-Release 2, Minecraft 1.9 Pre-Release 4, Minecraft 1.9, Minecraft 1.9.4, Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w39a, Minecraft 1.11.2, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w50a, Minecraft 18w06a, Minecraft 18w22c, Minecraft 1.13-pre1, Minecraft 1.13.1, Minecraft 1.13.2
-
Confirmed
The code in ChunkSelection.java that reports if a specific part of a chunk needs to be delivered to a client or not is faulty:
I'm not sure what the Class is named in the obfuscation. In the partially deobfuscated code it's ChunkSelection.java and the method's name is public boolean a().
I'm guessing it's public boolean hasBlockData() in the original code
public boolean a(){ return this.nonEmptyBlockCount == 0; }
This method is called when a Chunk is placed in the OutgoingQueue to a client. It checks if a ChunkSelection should be delivered or not.
The code does not consider the fact that - even if there is no block in a chunkselection - there may still be light-information for that selection.
This results in light-Bugs on the client side if a Chunk hast light-information in a chunkselection that does not contain any blocks.
- World Seed for reproduction: -9208998853395889608 ( 1.8.x WorldGenerator. Specifically 1.8.6 singleplayer in the video)
This Video presents the bug: https://www.youtube.com/watch?v=sfikoyETsJU ( 63 Seconds )
Video content:
- Connecting to a Singleplayer World (same in Multiplayer)
- Two chunks have obvious light-Information missing
- Teleporting does not fix the problem
- Placing a Block inside that specific chunkselection - thus working around the bug - does not fix the bug initially as the information only get updated on ChunkSending.
- Teleporting post the workaround does fix the bug
- Removing the Block - recreating the empty chunkselection and recreating the bug does work post teleport
- F3 shows we are exactly at the edge of a chunkSelection (63/64)
- The client-side light-updates in the area around a player does only fix the problem temporarily
This can be fixed by changing the code:
public boolean a(){ // return this.nonEmptyBlockCount == 0; return false; //kade fix, bukkit/mc reports wrongly if a part of a chunk is empty or not. }
Performance and Gameplay implications of this bugfix
- Performance
The performance impact is negligible. The problem occurs in <5% of chunks. Specifically: It occurs in every Chunk that has Blocks at the top of one ChunkSelection and light-information in the one above that but no blocks.
- Bandwidth
The Bandwidth increases a small amount for the <5% Chunks. But as all that is being sent is the light-map we are talking about a compressed data of only some bytes more.
- Gameplay
There are absolutely no side-effects of this fix. I have been running this code-change on my servers for at least 1 1/2 years now (concurrent playercount > 300).
Conclusion
In essence the Idea behind the "nonEmptyBlockCount == 0"-Check is good. But its neglecting the fact that there might be light-information present. As ChunkSelections without any lightinformation are null anyways there is no need for that check.
- is duplicated by
-
MC-8274 Shadows do not work good [Snapshot 13w04a]
- Resolved
-
MC-8748 Lighting Glich
- Resolved
-
MC-9514 Lighting ignores ceiling
- Resolved
-
MC-10052 There is a lighting bug in my mob trap system were inside there is light even though there is no physical ligth source there
- Resolved
-
MC-10146 Oh Shadow!!!!!!!!!!!!!!!
- Resolved
-
MC-11174 Flatworld light problem.
- Resolved
-
MC-11526 Light does not update correctly if source is 100 blocks away vertically
- Resolved
-
MC-13031 Large, enclosed space lit
- Resolved
-
MC-14962 I have a large room in the sky. When I logged off and then back on the room became bright instead of dark ( There is no light source). I just want to know if monsters will still spawn in that room as it is supposed to be dark.
- Resolved
-
MC-15235 Lighting bug with leaves
- Resolved
-
MC-19576 Is there any light?
- Resolved
-
MC-25524 Lighting Issue East Facing
- Resolved
-
MC-28990 Y:127 lighting glitch
- Resolved
-
MC-46354 light issue
- Resolved
-
MC-49778 Strange light in the dark
- Resolved
-
MC-55133 Bad Lighting Glitch!
- Resolved
-
MC-62892 Lighting Bug
- Resolved
-
MC-63033 Lighting Bug
- Resolved
-
MC-63052 Stone not blocking light
- Resolved
-
MC-64508 Light levels incorrect/no light
- Resolved
-
MC-72713 Lighting issue on vertical faces on chunk boundaries
- Resolved
-
MC-81385 Lava goes dark.
- Resolved
-
MC-88939 Black spot below block on y-chunk start
- Resolved
-
MC-90520 Lighting does not readily update across chunk boundaries when torches are placed/light loads improperly.
- Resolved
-
MC-90795 block light in some areas always remains 0
- Resolved
-
MC-91566 Lighting Glitch With Redstone Lamps Powered By Daylight Sensors
- Resolved
-
MC-97055 lightning bug when a block is at y 15 chunk coordinates and a block is at least 17 blocks above it
- Resolved
-
MC-99970 Lighting bug: Blocks in certain area stay black (unlighted) on one side
- Resolved
-
MC-103032 Shadow errors and block textures turning black.
- Resolved
-
MC-104432 Multiplayer – Light levels around beacon on chunk edges are incorrect
- Resolved
-
MC-105169 Bug Lighting
- Resolved
-
MC-105696 Lighting doesn't load correctly
- Resolved
-
MC-116690 Light does not spread to unloaded/empty chunks
- Resolved
-
MC-117439 Light with no light source
- Resolved
-
MC-118814 Darkness come back
- Resolved
-
MC-119976 Lighting bug
- Resolved
-
MC-120080 Weird Skylight value after reloading a map
- Resolved
-
MC-120901 SeaLantern light graphic issue
- Resolved
-
MC-127944 black shadows appear in my buildings whenever I enter the game
- Resolved
-
MC-130505 Lighting not applying
- Resolved
-
MC-132626 The upper part of the stairs will be built at a relatively high level. The height of the block below will make the block dark
- Resolved
-
MC-135502 Lighting is randomly broken
- Resolved
-
MC-531 One-Block thick ceilings not casting shadows when chunk is unloaded and reloaded
- Resolved
-
MC-911 Sunlight in big caves and under overhangs
- Resolved
-
MC-1254 Phantom skylight - sunlight appears in impossible areas
- Resolved
-
MC-2318 sl value is glitched in the End
- Resolved
-
MC-2907 light levels in an enclosed space fluctuating between 0 and 15 with no light sources. bl=0 sl=15 rl=15. fully enclosed(3 deep) with dirt.
- Resolved
- relates to
-
MC-142134 Light sources spontaneously not working in some chunks
- Resolved
-
MC-7508 lighting error due to Chunk.heightMap ignoring block at the top level of an ExtendedBlockStorage instance (off by 1 error)
- Resolved
-
MC-29490 1.7+ lighting bug / black spots
- Resolved
-
MC-91136 Lighting update is delayed at chunk borders
- Resolved
-
MC-1018 Black Lighting under overhangs
- Resolved
-
MC-3329 Naturally generated light sources (fire, glowstone, torches etc.) sometimes do not emit light
- Resolved