Class LayerLightSectionStorage<M extends DataLayerStorageMap<M>>

java.lang.Object
net.minecraft.world.level.lighting.LayerLightSectionStorage<M>
Direct Known Subclasses:
BlockLightSectionStorage, SkyLightSectionStorage

public abstract class LayerLightSectionStorage<M extends DataLayerStorageMap<M>> extends Object
  • Field Details

    • layer

      private final LightLayer layer
    • chunkSource

      protected final LightChunkGetter chunkSource
    • sectionStates

      protected final it.unimi.dsi.fastutil.longs.Long2ByteMap sectionStates
    • columnsWithSources

      private final it.unimi.dsi.fastutil.longs.LongSet columnsWithSources
    • visibleSectionData

      protected volatile M extends DataLayerStorageMap<M> visibleSectionData
    • updatingSectionData

      protected final M extends DataLayerStorageMap<M> updatingSectionData
    • changedSections

      protected final it.unimi.dsi.fastutil.longs.LongSet changedSections
    • sectionsAffectedByLightUpdates

      protected final it.unimi.dsi.fastutil.longs.LongSet sectionsAffectedByLightUpdates
    • queuedSections

      protected final it.unimi.dsi.fastutil.longs.Long2ObjectMap<DataLayer> queuedSections
    • columnsToRetainQueuedDataFor

      private final it.unimi.dsi.fastutil.longs.LongSet columnsToRetainQueuedDataFor
      Section column positions (section positions with Y=0) that need to be kept even if some of their sections could otherwise be removed.
    • toRemove

      private final it.unimi.dsi.fastutil.longs.LongSet toRemove
      Set of section positions that can be removed, because their light won't affect any blocks.
    • hasInconsistencies

      protected volatile boolean hasInconsistencies
  • Constructor Details

    • LayerLightSectionStorage

      protected LayerLightSectionStorage(LightLayer pLayer, LightChunkGetter pChunkSource, M pUpdatingSectionData)
  • Method Details

    • storingLightForSection

      protected boolean storingLightForSection(long pSectionPos)
    • getDataLayer

      @Nullable protected DataLayer getDataLayer(long pSectionPos, boolean pCached)
    • getDataLayer

      @Nullable protected DataLayer getDataLayer(M pMap, long pSectionPos)
    • getDataLayerToWrite

      @Nullable protected DataLayer getDataLayerToWrite(long pSectionPos)
    • getDataLayerData

      @Nullable public DataLayer getDataLayerData(long pSectionPos)
    • getLightValue

      protected abstract int getLightValue(long pLevelPos)
    • getStoredLevel

      protected int getStoredLevel(long pLevelPos)
    • setStoredLevel

      protected void setStoredLevel(long pLevelPos, int pLightLevel)
    • markSectionAndNeighborsAsAffected

      protected void markSectionAndNeighborsAsAffected(long pSectionPos)
    • createDataLayer

      protected DataLayer createDataLayer(long pSectionPos)
    • hasInconsistencies

      protected boolean hasInconsistencies()
    • markNewInconsistencies

      protected void markNewInconsistencies(LightEngine<M,?> pLightEngine)
    • onNodeAdded

      protected void onNodeAdded(long pSectionPos)
    • onNodeRemoved

      protected void onNodeRemoved(long pSectionPos)
    • setLightEnabled

      protected void setLightEnabled(long pSectionPos, boolean pLightEnabled)
    • lightOnInSection

      protected boolean lightOnInSection(long pSectionPos)
    • retainData

      public void retainData(long pSectionColumnPos, boolean pRetain)
    • queueSectionData

      protected void queueSectionData(long pSectionPos, @Nullable DataLayer pData)
    • updateSectionStatus

      protected void updateSectionStatus(long pSectionPos, boolean pIsEmpty)
    • putSectionState

      protected void putSectionState(long pSectionPos, byte pSectionState)
    • initializeSection

      private void initializeSection(long pSectionPos)
    • removeSection

      private void removeSection(long pSectionPos)
    • swapSectionMap

      protected void swapSectionMap()
    • getDebugSectionType

      public LayerLightSectionStorage.SectionType getDebugSectionType(long pSectionPos)