Interface LightListener

All Known Subinterfaces:
TickingLightListener
All Known Implementing Classes:
AbstractInstance, BellInstance, BlockEntityInstance, ChestInstance, EntityInstance, GPULightVolume, LightVolume, MinecartInstance, ShulkerBoxInstance

public interface LightListener
Implementors of this interface may choose to subscribe to light updates by calling LightUpdater.addListener(LightListener).

It is the responsibility of the implementor to keep a reference to the level an object is contained in.

  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
    Check the status of the light listener.
    default void
    onLightPacket(int chunkX, int chunkZ)
    Called when the server sends light data to the client.
    void
    onLightUpdate(net.minecraft.world.level.LightLayer type, ImmutableBox changed)
    Called when a light updates in a chunk the implementor cares about.
  • Method Details

    • getVolume

      ImmutableBox getVolume()
    • isListenerInvalid

      boolean isListenerInvalid()
      Check the status of the light listener.
      Returns:
      true if the listener is invalid/removed/deleted, and should no longer receive updates.
    • onLightUpdate

      void onLightUpdate(net.minecraft.world.level.LightLayer type, ImmutableBox changed)
      Called when a light updates in a chunk the implementor cares about.
    • onLightPacket

      default void onLightPacket(int chunkX, int chunkZ)
      Called when the server sends light data to the client.