Class LightEngine<M extends DataLayerStorageMap<M>,S extends LayerLightSectionStorage<M>>

java.lang.Object
net.minecraft.world.level.lighting.LightEngine<M,S>
All Implemented Interfaces:
LayerLightEventListener, LightEventListener
Direct Known Subclasses:
BlockLightEngine, SkyLightEngine

public abstract class LightEngine<M extends DataLayerStorageMap<M>,S extends LayerLightSectionStorage<M>> extends Object implements LayerLightEventListener
  • Field Details

    • MAX_LEVEL

      public static final int MAX_LEVEL
      See Also:
    • MIN_OPACITY

      protected static final int MIN_OPACITY
      See Also:
    • PULL_LIGHT_IN_ENTRY

      protected static final long PULL_LIGHT_IN_ENTRY
    • MIN_QUEUE_SIZE

      private static final int MIN_QUEUE_SIZE
      See Also:
    • PROPAGATION_DIRECTIONS

      protected static final Direction[] PROPAGATION_DIRECTIONS
    • chunkSource

      protected final LightChunkGetter chunkSource
    • storage

      protected final S extends LayerLightSectionStorage<M> storage
    • blockNodesToCheck

      private final it.unimi.dsi.fastutil.longs.LongOpenHashSet blockNodesToCheck
    • decreaseQueue

      private final it.unimi.dsi.fastutil.longs.LongArrayFIFOQueue decreaseQueue
    • increaseQueue

      private final it.unimi.dsi.fastutil.longs.LongArrayFIFOQueue increaseQueue
    • CACHE_SIZE

      private static final int CACHE_SIZE
      See Also:
    • lastChunkPos

      private final long[] lastChunkPos
    • lastChunk

      private final LightChunk[] lastChunk
  • Constructor Details

  • Method Details

    • hasDifferentLightProperties

      @Deprecated public static boolean hasDifferentLightProperties(BlockState p_285110_, BlockState p_285372_)
      Deprecated.
      Neo: use overload with level context instead
    • hasDifferentLightProperties

      public static boolean hasDifferentLightProperties(BlockGetter level, BlockPos pos, BlockState p_285110_, BlockState p_285372_)
    • getLightBlockInto

      public static int getLightBlockInto(BlockState p_285453_, BlockState p_285318_, Direction p_285196_, int p_285248_)
    • getOcclusionShape

      public static VoxelShape getOcclusionShape(BlockState p_285020_, Direction p_285455_)
    • isEmptyShape

      protected static boolean isEmptyShape(BlockState p_285133_)
    • getState

      protected BlockState getState(BlockPos p_285338_)
    • getOpacity

      protected int getOpacity(BlockState p_285084_)
    • shapeOccludes

      protected boolean shapeOccludes(BlockState p_285154_, BlockState p_285155_, Direction p_285327_)
    • getChunk

      @Nullable protected LightChunk getChunk(int p_284967_, int p_285447_)
    • clearChunkCache

      private void clearChunkCache()
    • checkBlock

      public void checkBlock(BlockPos p_285352_)
      Specified by:
      checkBlock in interface LightEventListener
    • queueSectionData

      public void queueSectionData(long p_285221_, @Nullable DataLayer p_285427_)
    • retainData

      public void retainData(ChunkPos p_285314_, boolean p_284937_)
    • updateSectionStatus

      public void updateSectionStatus(SectionPos p_285167_, boolean p_284934_)
      Specified by:
      updateSectionStatus in interface LightEventListener
    • setLightEnabled

      public void setLightEnabled(ChunkPos p_285116_, boolean p_285522_)
      Specified by:
      setLightEnabled in interface LightEventListener
    • runLightUpdates

      public int runLightUpdates()
      Specified by:
      runLightUpdates in interface LightEventListener
    • propagateIncreases

      private int propagateIncreases()
    • propagateDecreases

      private int propagateDecreases()
    • enqueueDecrease

      protected void enqueueDecrease(long p_285228_, long p_285464_)
    • enqueueIncrease

      protected void enqueueIncrease(long p_285223_, long p_285022_)
    • hasLightWork

      public boolean hasLightWork()
      Specified by:
      hasLightWork in interface LightEventListener
    • getDataLayerData

      @Nullable public DataLayer getDataLayerData(SectionPos p_285093_)
      Specified by:
      getDataLayerData in interface LayerLightEventListener
    • getLightValue

      public int getLightValue(BlockPos p_285149_)
      Specified by:
      getLightValue in interface LayerLightEventListener
    • getDebugData

      public String getDebugData(long p_285363_)
    • getDebugSectionType

      public LayerLightSectionStorage.SectionType getDebugSectionType(long p_285320_)
    • checkNode

      protected abstract void checkNode(long p_285507_)
    • propagateIncrease

      protected abstract void propagateIncrease(long p_285325_, long p_285026_, int p_285197_)
    • propagateDecrease

      protected abstract void propagateDecrease(long p_284941_, long p_285213_)