Starlight (Fabric)

Starlight (Fabric)

15M Downloads

Mushrooms don't generate

YetAnotherMcModder opened this issue ยท 1 comments

commented

Minecraft version: 1.20.1 (server side)
Mod version 1.1.2 (Fabric)

Brown & red mushrooms don't generate in swamps or underground in caves.
Red and blue mushrooms generate fine in the nether. Most likely cause is light level is too high for them to generate when generating the chunk, it only becomes correct after the chunk has been populated.

Steps to reproduce:

  1. Create a new world with a set seed. (In vanilla)
  2. Locate a swamp.
  3. Try to find mushrooms.
  4. Repeat with mod enabled.
commented

Well this sucks. Mojang used to not check the light value during generation (as it is invalid at that stage), and instead relied on post-processing to remove mushrooms if the light level was too high (and the code to do the post-processing still exists).

This still happens in Vanilla, but there is a chance in Vanilla that the lightmaps for the section are partially initialised, which will result in the light value being 0 (incorrect, but now it is in range for the mushroom). Starlight does not perform initialisation of light until the LIGHT stage, so for a chunk during generation the skylight is always 15.

I can hopefully just fix this specific case by returning 0 during worldgen when the chunk is not marked as having correct light.