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 updatingSectionData) -
Method Summary
Modifier and TypeMethodDescriptionprotected DataLayercreateDataLayer(long sectionPos) protected @Nullable DataLayergetDataLayer(long sectionPos, boolean cached) protected @Nullable DataLayergetDataLayer(M map, long sectionPos) @Nullable DataLayergetDataLayerData(long sectionPos) protected @Nullable DataLayergetDataLayerToWrite(long sectionPos) getDebugSectionType(long sectionPos) protected abstract intgetLightValue(long pos) protected intgetStoredLevel(long pos) protected booleanprivate voidinitializeSection(long sectionPos) protected booleanlightOnInColumn(long columnPos) protected booleanlightOnInSection(long sectionPos) protected voidmarkNewInconsistencies(LightEngine<M, ?> lightEngine) protected voidmarkSectionAndNeighborsAsAffected(long sectionPos) protected voidonNodeAdded(long sectionPos) protected voidonNodeRemoved(long sectionPos) protected voidputSectionState(long sectionPos, byte sectionState) protected voidqueueSectionData(long sectionPos, @Nullable DataLayer data) private voidremoveSection(long sectionPos) voidretainData(long sectionColumnPos, boolean retain) protected voidsetLightEnabled(long sectionPos, boolean lightEnabled) protected voidsetStoredLevel(long pos, int lightLevel) protected booleanstoringLightForSection(long sectionPos) protected voidprotected voidupdateSectionStatus(long sectionPos, boolean isEmpty)
-
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 layer, LightChunkGetter chunkSource, M updatingSectionData)
-
-
Method Details
-
storingLightForSection
protected boolean storingLightForSection(long sectionPos) -
getDataLayer
-
getDataLayer
-
getDataLayerToWrite
-
getDataLayerData
-
getLightValue
protected abstract int getLightValue(long pos) -
getStoredLevel
protected int getStoredLevel(long pos) -
setStoredLevel
protected void setStoredLevel(long pos, int lightLevel) -
markSectionAndNeighborsAsAffected
protected void markSectionAndNeighborsAsAffected(long sectionPos) -
createDataLayer
-
hasInconsistencies
protected boolean hasInconsistencies() -
markNewInconsistencies
-
onNodeAdded
protected void onNodeAdded(long sectionPos) -
onNodeRemoved
protected void onNodeRemoved(long sectionPos) -
setLightEnabled
protected void setLightEnabled(long sectionPos, boolean lightEnabled) -
lightOnInSection
protected boolean lightOnInSection(long sectionPos) -
lightOnInColumn
protected boolean lightOnInColumn(long columnPos) -
retainData
public void retainData(long sectionColumnPos, boolean retain) -
queueSectionData
-
updateSectionStatus
protected void updateSectionStatus(long sectionPos, boolean isEmpty) -
putSectionState
protected void putSectionState(long sectionPos, byte sectionState) -
initializeSection
private void initializeSection(long sectionPos) -
removeSection
private void removeSection(long sectionPos) -
swapSectionMap
protected void swapSectionMap() -
getDebugSectionType
-