Class SkyLightEngine
java.lang.Object
net.minecraft.world.level.lighting.LightEngine<SkyLightSectionStorage.SkyDataLayerStorageMap,SkyLightSectionStorage>
net.minecraft.world.level.lighting.SkyLightEngine
- All Implemented Interfaces:
LayerLightEventListener
,LightEventListener
public final class SkyLightEngine
extends LightEngine<SkyLightSectionStorage.SkyDataLayerStorageMap,SkyLightSectionStorage>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.lighting.LightEngine
LightEngine.QueueEntry
Nested classes/interfaces inherited from interface net.minecraft.world.level.lighting.LayerLightEventListener
LayerLightEventListener.DummyLightLayerEventListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
private final ChunkSkyLightSources
private final BlockPos.MutableBlockPos
private static final long
private static final long
Fields inherited from class net.minecraft.world.level.lighting.LightEngine
chunkSource, MAX_LEVEL, MIN_OPACITY, PROPAGATION_DIRECTIONS, PULL_LIGHT_IN_ENTRY, storage
-
Constructor Summary
ConstructorsModifierConstructorDescriptionSkyLightEngine
(LightChunkGetter chunkSource) protected
SkyLightEngine
(LightChunkGetter chunkSource, SkyLightSectionStorage sectionStorage) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addSourcesAbove
(int x, int z, int maxY, int bottomSectionY) protected void
checkNode
(long levelPos) private int
countEmptySectionsBelowIfAtBorder
(long packedPos) private static boolean
crossedSectionEdge
(Direction direction, int x, int z) private ChunkSkyLightSources
getChunkSources
(int chunkX, int chunkZ) private int
getLowestSourceY
(int x, int z, int defaultReturnValue) private static boolean
isSourceLevel
(int level) protected void
propagateDecrease
(long packedPos, long lightLevel) private void
propagateFromEmptySections
(long packedPos, Direction direction, int level, boolean shouldIncrease, int emptySections) protected void
propagateIncrease
(long packedPos, long queueEntry, int lightLevel) void
propagateLightSources
(ChunkPos chunkPos) private void
removeSourcesBelow
(int x, int z, int minY, int bottomSectionY) void
setLightEnabled
(ChunkPos chunkPos, boolean lightEnabled) private void
updateSourcesInColumn
(int x, int z, int lowestY) Methods inherited from class net.minecraft.world.level.lighting.LightEngine
checkBlock, enqueueDecrease, enqueueIncrease, getChunk, getDataLayerData, getDebugData, getDebugSectionType, getLightBlockInto, getLightValue, getOcclusionShape, getOcclusionShape, getOpacity, getState, hasDifferentLightProperties, hasLightWork, isEmptyShape, queueSectionData, retainData, runLightUpdates, shapeOccludes, updateSectionStatus
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.world.level.lighting.LightEventListener
updateSectionStatus
-
Field Details
-
REMOVE_TOP_SKY_SOURCE_ENTRY
private static final long REMOVE_TOP_SKY_SOURCE_ENTRY -
REMOVE_SKY_SOURCE_ENTRY
private static final long REMOVE_SKY_SOURCE_ENTRY -
ADD_SKY_SOURCE_ENTRY
private static final long ADD_SKY_SOURCE_ENTRY -
mutablePos
-
emptyChunkSources
-
-
Constructor Details
-
SkyLightEngine
-
SkyLightEngine
@VisibleForTesting protected SkyLightEngine(LightChunkGetter chunkSource, SkyLightSectionStorage sectionStorage)
-
-
Method Details
-
isSourceLevel
private static boolean isSourceLevel(int level) -
getLowestSourceY
private int getLowestSourceY(int x, int z, int defaultReturnValue) -
getChunkSources
-
checkNode
protected void checkNode(long levelPos) - Specified by:
checkNode
in classLightEngine<SkyLightSectionStorage.SkyDataLayerStorageMap,
SkyLightSectionStorage>
-
updateSourcesInColumn
private void updateSourcesInColumn(int x, int z, int lowestY) -
removeSourcesBelow
private void removeSourcesBelow(int x, int z, int minY, int bottomSectionY) -
addSourcesAbove
private void addSourcesAbove(int x, int z, int maxY, int bottomSectionY) -
propagateIncrease
protected void propagateIncrease(long packedPos, long queueEntry, int lightLevel) - Specified by:
propagateIncrease
in classLightEngine<SkyLightSectionStorage.SkyDataLayerStorageMap,
SkyLightSectionStorage>
-
propagateDecrease
protected void propagateDecrease(long packedPos, long lightLevel) - Specified by:
propagateDecrease
in classLightEngine<SkyLightSectionStorage.SkyDataLayerStorageMap,
SkyLightSectionStorage>
-
countEmptySectionsBelowIfAtBorder
private int countEmptySectionsBelowIfAtBorder(long packedPos) -
propagateFromEmptySections
private void propagateFromEmptySections(long packedPos, Direction direction, int level, boolean shouldIncrease, int emptySections) -
crossedSectionEdge
-
setLightEnabled
- Specified by:
setLightEnabled
in interfaceLightEventListener
- Overrides:
setLightEnabled
in classLightEngine<SkyLightSectionStorage.SkyDataLayerStorageMap,
SkyLightSectionStorage>
-
propagateLightSources
-