Interface LightUpdatedVisual

All Superinterfaces:
SectionTrackedVisual, Visual
All Known Implementing Classes:
AbstractBlockEntityVisual

public non-sealed interface LightUpdatedVisual extends SectionTrackedVisual
A visual that listens to light updates.

If your visual moves around in the level at all, you should use TickableVisual or DynamicVisual, and poll for light yourself along with listening for updates. When your visual moves to a different section, call SectionTrackedVisual.SectionCollector.sections(it.unimi.dsi.fastutil.longs.LongSet).

  • Method Details

    • updateLight

      void updateLight(float partialTick)
      Called after visual construction and when a section this visual is contained in receives a light update.

      Even if multiple sections are updated at the same time, this method will only be called once.

      The implementation is free to parallelize calls to this method, as well as execute the plan returned by DynamicVisual.planFrame() simultaneously. It is safe to query/update light here, but you must ensure proper synchronization if you want to mutate anything outside this visual or anything that is also mutated within DynamicVisual.planFrame().