mojira.dev
MC-7473

LC value used in client may not reflect the LC value calculated by server

The LC parameter which shows when you have debug enabled, is an index of the upper y coordinate of the chunk section which has the highest non-air block for that chunk. This parameter is important in the calculations for entity spawning. When you place a block above that section or remove every non-air block out of that section, the section should be unloaded or loaded as applicable and the LC parameter should correctly reflect this change.

What happens when you remove a section:
When you remove a section of a chunk, e.g. by removing all non-air blocks. The section stays loaded and the server still uses these empty sections for calculations like mobspawning. This does not change if you reload the world! However, if you reload the world, the client's LC parameter will reflect that it has been recalculated (even though the section has not been unloaded on the server).

What should happen:
When a section is completely empty it should not be loaded, the LC parameter should reflect that it is not loaded. And any calculations for mob spawning etc, should use the correct LC value. The client should always show the correct LC value.

How to fix:
There is a method in the Chunk class (abw.class) which checks for the topmost filled section in a chunk (int h()). Don't just check that the section is not null, but also that it is not empty.

This video details the problem and the fix
http://youtu.be/LIDNyB-Ys8w

This bug has existed for a long time, let's get it fixed !

Linked issues

Comments 42

I can confirm the the LC parameter is inconsistent. I logged in to my SMP server today and the LC parameter of a chunk that used to be 47 is not back to 79 again. Even though there has been nothing built in that chunk at all. Very weird behavior.

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

This post does not describe this bug correctly and also suggests a senseless and inefficient solution. To fix this bug appropriately look at this post: MC-13544

To be more precise, what is described here is not the problem. That is how it should be working, but since there is an even simpler solution to fix this than like that, I made this other post.

Was that still not clear enough? This issue is wrong! What is beeing decribed here would not be a bug if it was true!

32 more comments
[Mod] redstonehelper

1.8-pre1: lc is no longer displayed in F3.

@@unknown: That may cover the symptoms, but is the cause fixed ?

[Mod] redstonehelper

@Kumasasa: The underlying issue (mob spawning also checks sections full of air) is not the main issue of this bug report, is it? Also, I heard somewhere that in 1.8, the LC value will no longer have any effect on mob spawning, as the entire 256 blocks world height will be checked; But I can't personally verify this or have a source, so you'll have to take this with a grain of salt.

edit: While the cause may not be fixed (I don't know if it is), does this have any other effects?

Is this still a concern in the current Minecraft version 1.8.1 Prerelease 3 / Launcher version 1.5.3 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

No response for over a year.

Bryan Brown

(Unassigned)

Community Consensus

Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w02a, Snapshot 13w02b, Minecraft 1.5, ..., Minecraft 13w41b, Minecraft 13w42a, Minecraft 13w42b, Minecraft 1.7.4, Minecraft 14w04b

Retrieved