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 pChunkSource) protected
SkyLightEngine
(LightChunkGetter pChunkSource, SkyLightSectionStorage pSectionStorage) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addSourcesAbove
(int pX, int pZ, int pMaxY, int pBottomSectionY) protected void
checkNode
(long pLevelPos) private int
countEmptySectionsBelowIfAtBorder
(long pPackedPos) private static boolean
crossedSectionEdge
(Direction pDirection, int pX, int pZ) private ChunkSkyLightSources
getChunkSources
(int pChunkX, int pChunkZ) private int
getLowestSourceY
(int pX, int pZ, int pDefaultReturnValue) private static boolean
isSourceLevel
(int pLevel) protected void
propagateDecrease
(long pPackedPos, long pLightLevel) private void
propagateFromEmptySections
(long pPackedPos, Direction pDirection, int pLevel, boolean pShouldIncrease, int pEmptySections) protected void
propagateIncrease
(long pPackedPos, long pQueueEntry, int pLightLevel) void
propagateLightSources
(ChunkPos pChunkPos) private void
removeSourcesBelow
(int pX, int pZ, int pMinY, int pBottomSectionY) void
setLightEnabled
(ChunkPos pChunkPos, boolean pLightEnabled) private void
updateSourcesInColumn
(int pX, int pZ, int pLowestY) 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 pChunkSource, SkyLightSectionStorage pSectionStorage)
-
-
Method Details
-
isSourceLevel
private static boolean isSourceLevel(int pLevel) -
getLowestSourceY
private int getLowestSourceY(int pX, int pZ, int pDefaultReturnValue) -
getChunkSources
-
checkNode
protected void checkNode(long pLevelPos) - Specified by:
checkNode
in classLightEngine<SkyLightSectionStorage.SkyDataLayerStorageMap,
SkyLightSectionStorage>
-
updateSourcesInColumn
private void updateSourcesInColumn(int pX, int pZ, int pLowestY) -
removeSourcesBelow
private void removeSourcesBelow(int pX, int pZ, int pMinY, int pBottomSectionY) -
addSourcesAbove
private void addSourcesAbove(int pX, int pZ, int pMaxY, int pBottomSectionY) -
propagateIncrease
protected void propagateIncrease(long pPackedPos, long pQueueEntry, int pLightLevel) - Specified by:
propagateIncrease
in classLightEngine<SkyLightSectionStorage.SkyDataLayerStorageMap,
SkyLightSectionStorage>
-
propagateDecrease
protected void propagateDecrease(long pPackedPos, long pLightLevel) - Specified by:
propagateDecrease
in classLightEngine<SkyLightSectionStorage.SkyDataLayerStorageMap,
SkyLightSectionStorage>
-
countEmptySectionsBelowIfAtBorder
private int countEmptySectionsBelowIfAtBorder(long pPackedPos) -
propagateFromEmptySections
private void propagateFromEmptySections(long pPackedPos, Direction pDirection, int pLevel, boolean pShouldIncrease, int pEmptySections) -
crossedSectionEdge
-
setLightEnabled
- Specified by:
setLightEnabled
in interfaceLightEventListener
- Overrides:
setLightEnabled
in classLightEngine<SkyLightSectionStorage.SkyDataLayerStorageMap,
SkyLightSectionStorage>
-
propagateLightSources
-