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 layer, LightChunkGetter chunkSource, M initialMap) -
Method Summary
Modifier and TypeMethodDescriptionprotected DataLayercreateDataLayer(long sectionNode) protected @Nullable DataLayergetDataLayer(long sectionNode, boolean updating) protected @Nullable DataLayergetDataLayer(M sections, long sectionNode) @Nullable DataLayergetDataLayerData(long sectionNode) protected @Nullable DataLayergetDataLayerToWrite(long sectionNode) getDebugSectionType(long sectionNode) protected abstract intgetLightValue(long blockNode) protected intgetStoredLevel(long blockNode) protected booleanprivate voidinitializeSection(long sectionNode) protected booleanlightOnInColumn(long sectionZeroNode) protected booleanlightOnInSection(long sectionNode) protected voidmarkNewInconsistencies(LightEngine<M, ?> engine) protected voidmarkSectionAndNeighborsAsAffected(long sectionNode) protected voidonNodeAdded(long sectionNode) protected voidonNodeRemoved(long sectionNode) protected voidputSectionState(long sectionNode, byte state) protected voidqueueSectionData(long sectionNode, @Nullable DataLayer data) private voidremoveSection(long sectionNode) voidretainData(long zeroNode, boolean retain) protected voidsetLightEnabled(long zeroNode, boolean enable) protected voidsetStoredLevel(long blockNode, int level) protected booleanstoringLightForSection(long sectionNode) protected voidprotected voidupdateSectionStatus(long sectionNode, boolean sectionEmpty)
-
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
-
-
Method Details
-
storingLightForSection
protected boolean storingLightForSection(long sectionNode) -
getDataLayer
-
getDataLayer
-
getDataLayerToWrite
-
getDataLayerData
-
getLightValue
protected abstract int getLightValue(long blockNode) -
getStoredLevel
protected int getStoredLevel(long blockNode) -
setStoredLevel
protected void setStoredLevel(long blockNode, int level) -
markSectionAndNeighborsAsAffected
protected void markSectionAndNeighborsAsAffected(long sectionNode) -
createDataLayer
-
hasInconsistencies
protected boolean hasInconsistencies() -
markNewInconsistencies
-
onNodeAdded
protected void onNodeAdded(long sectionNode) -
onNodeRemoved
protected void onNodeRemoved(long sectionNode) -
setLightEnabled
protected void setLightEnabled(long zeroNode, boolean enable) -
lightOnInSection
protected boolean lightOnInSection(long sectionNode) -
lightOnInColumn
protected boolean lightOnInColumn(long sectionZeroNode) -
retainData
public void retainData(long zeroNode, boolean retain) -
queueSectionData
-
updateSectionStatus
protected void updateSectionStatus(long sectionNode, boolean sectionEmpty) -
putSectionState
protected void putSectionState(long sectionNode, byte state) -
initializeSection
private void initializeSection(long sectionNode) -
removeSection
private void removeSection(long sectionNode) -
swapSectionMap
protected void swapSectionMap() -
getDebugSectionType
-