mojira.dev
MC-164281

Lighting thread and gameplay thread can desync

The bug

In a previous version the lighting engine was moved to a separate thread. However it appears there is nothing which prevents desync between the gameplay and the lighting thread.

This can cause all kind of unexpected behavior, for example:

  • Being unable to plant crops in lit up caves

  • Monters spawning in lit up areas

  • ⚠️ Stopping the server / closing a world when the lighting thread has not caught up causes pending light updates to get lost

How to reproduce

  1. Place a repeating command block (always active), pointing upwards

    fill ~ 255 ~ ~20 255 ~20 stone
  2. Place a chain command block above (always active)

    fill ~ 255 ~ ~20 255 ~20 air
  3. Set the time to night

    /time set night
  4. Open the debug screen (F3)

  5. Place a light source, e.g. a torch
    ❌ The "block" value for "Server light" does not change

  6. Reopen the world
    ❌ The area around the light source is not lit up

Linked issues

Comments 5

In 1.16.1 and 20w29a

In 1.16.2

Can confirm in 20w51a.

Can confirm in 21w40a.

I am no longer able to reproduce this in 1.20.1 with the provided reproduction steps. Is this still an issue?

marcono1234

(Unassigned)

Confirmed

Normal

Lighting

19w42a, 1.15.2, 20w15a, 1.16.2, 20w51a, 21w40a

Retrieved