Class LayerLightSectionStorage<M extends DataLayerStorageMap<M>>
java.lang.Object
net.minecraft.world.level.lighting.LayerLightSectionStorage<M>
- Direct Known Subclasses:
BlockLightSectionStorage,SkyLightSectionStorage
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final it.unimi.dsi.fastutil.longs.LongSetprotected final LightChunkGetterprivate final it.unimi.dsi.fastutil.longs.LongSetSection column positions (section positions with Y=0) that need to be kept even if some of their sections could otherwise be removed.private final it.unimi.dsi.fastutil.longs.LongSetprotected booleanprivate final LightLayerprotected final it.unimi.dsi.fastutil.longs.Long2ObjectMap<DataLayer> protected final it.unimi.dsi.fastutil.longs.LongSetprotected final it.unimi.dsi.fastutil.longs.Long2ByteMapprivate final it.unimi.dsi.fastutil.longs.LongSetSet of section positions that can be removed, because their light won't affect any blocks.protected final Mprotected M -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLayerLightSectionStorage(LightLayer pLayer, LightChunkGetter pChunkSource, M pUpdatingSectionData) -
Method Summary
Modifier and TypeMethodDescriptionprotected DataLayercreateDataLayer(long pSectionPos) protected DataLayergetDataLayer(long pSectionPos, boolean pCached) protected DataLayergetDataLayer(M pMap, long pSectionPos) getDataLayerData(long pSectionPos) protected DataLayergetDataLayerToWrite(long pSectionPos) getDebugSectionType(long pSectionPos) protected abstract intgetLightValue(long pLevelPos) protected intgetStoredLevel(long pLevelPos) protected booleanprivate voidinitializeSection(long pSectionPos) protected booleanlightOnInColumn(long pColumnPos) protected booleanlightOnInSection(long pSectionPos) protected voidmarkNewInconsistencies(LightEngine<M, ?> pLightEngine) protected voidmarkSectionAndNeighborsAsAffected(long pSectionPos) protected voidonNodeAdded(long pSectionPos) protected voidonNodeRemoved(long pSectionPos) protected voidputSectionState(long pSectionPos, byte pSectionState) protected voidqueueSectionData(long pSectionPos, DataLayer pData) private voidremoveSection(long pSectionPos) voidretainData(long pSectionColumnPos, boolean pRetain) protected voidsetLightEnabled(long pSectionPos, boolean pLightEnabled) protected voidsetStoredLevel(long pLevelPos, int pLightLevel) protected booleanstoringLightForSection(long pSectionPos) protected voidprotected voidupdateSectionStatus(long pSectionPos, boolean pIsEmpty)
-
Field Details
-
layer
-
chunkSource
-
sectionStates
protected final it.unimi.dsi.fastutil.longs.Long2ByteMap sectionStates -
columnsWithSources
private final it.unimi.dsi.fastutil.longs.LongSet columnsWithSources -
visibleSectionData
-
updatingSectionData
-
changedSections
protected final it.unimi.dsi.fastutil.longs.LongSet changedSections -
sectionsAffectedByLightUpdates
protected final it.unimi.dsi.fastutil.longs.LongSet sectionsAffectedByLightUpdates -
queuedSections
-
columnsToRetainQueuedDataFor
private final it.unimi.dsi.fastutil.longs.LongSet columnsToRetainQueuedDataForSection 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 toRemoveSet 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
-
getDataLayer
-
getDataLayerToWrite
-
getDataLayerData
-
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
-
hasInconsistencies
protected boolean hasInconsistencies() -
markNewInconsistencies
-
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) -
lightOnInColumn
protected boolean lightOnInColumn(long pColumnPos) -
retainData
public void retainData(long pSectionColumnPos, boolean pRetain) -
queueSectionData
-
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
-