Class LayerLightEngine<M extends DataLayerStorageMap<M>,S extends LayerLightSectionStorage<M>>
java.lang.Object
net.minecraft.world.level.lighting.DynamicGraphMinFixedPoint
net.minecraft.world.level.lighting.LayerLightEngine<M,S>
- All Implemented Interfaces:
LayerLightEventListener
,LightEventListener
- Direct Known Subclasses:
BlockLightEngine
,SkyLightEngine
public abstract class LayerLightEngine<M extends DataLayerStorageMap<M>,S extends LayerLightSectionStorage<M>>
extends DynamicGraphMinFixedPoint
implements LayerLightEventListener
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.level.lighting.LayerLightEventListener
LayerLightEventListener.DummyLightLayerEventListener
-
Field Summary
Modifier and TypeFieldDescriptionprivate static int
protected LightChunkGetter
private static Direction[]
private BlockGetter[]
private long[]
protected LightLayer
protected BlockPos.MutableBlockPos
private boolean
static long
protected S
-
Constructor Summary
ConstructorDescriptionLayerLightEngine(LightChunkGetter p_75640_, LightLayer p_75641_, S p_75642_)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkBlock(BlockPos p_75686_)
protected void
checkNode(long p_75708_)
private void
protected int
computeLevelFromNeighbor(long p_75696_, long p_75697_, int p_75698_)
void
enableLightSources(ChunkPos p_75676_, boolean p_75677_)
private BlockGetter
getChunk(int p_75645_, int p_75646_)
protected int
getComputedLevel(long p_75657_, long p_75658_, int p_75659_)
getDataLayerData(SectionPos p_75690_)
getDebugData(long p_75694_)
protected int
getLevel(long p_75705_)
protected int
static int
getLightBlockInto(BlockGetter p_75668_, BlockState p_75669_, BlockPos p_75670_, BlockState p_75671_, BlockPos p_75672_, Direction p_75673_, int p_75674_)
int
getLightValue(BlockPos p_75703_)
protected VoxelShape
getShape(BlockState p_75679_, long p_75680_, Direction p_75681_)
protected BlockState
getStateAndOpacity(long p_75665_, org.apache.commons.lang3.mutable.MutableInt p_75666_)
boolean
protected boolean
isSource(long p_75652_)
void
onBlockEmissionIncrease(BlockPos p_75687_, int p_75688_)
abstract int
protected void
queueSectionData(long p_75661_, DataLayer p_75662_, boolean p_75663_)
void
retainData(ChunkPos p_75700_, boolean p_75701_)
int
runUpdates(int p_75648_, boolean p_75649_, boolean p_75650_)
protected void
setLevel(long p_75654_, int p_75655_)
void
updateSectionStatus(SectionPos p_75692_, boolean p_75693_)
Methods inherited from class net.minecraft.world.level.lighting.DynamicGraphMinFixedPoint
checkEdge, checkNeighbor, checkNeighborsAfterUpdate, getQueueSize, hasWork, removeFromQueue, removeIf, runUpdates
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
-
SELF_SOURCE
public static final long SELF_SOURCE- See Also:
- Constant Field Values
-
DIRECTIONS
-
chunkSource
-
layer
-
storage
-
runningLightUpdates
private boolean runningLightUpdates -
pos
-
CACHE_SIZE
private static final int CACHE_SIZE- See Also:
- Constant Field Values
-
lastChunkPos
private final long[] lastChunkPos -
lastChunk
-
-
Constructor Details
-
LayerLightEngine
-
-
Method Details
-
checkNode
protected void checkNode(long p_75708_)- Overrides:
checkNode
in classDynamicGraphMinFixedPoint
-
getChunk
-
clearCache
private void clearCache() -
getStateAndOpacity
protected BlockState getStateAndOpacity(long p_75665_, @Nullable org.apache.commons.lang3.mutable.MutableInt p_75666_) -
getShape
-
getLightBlockInto
public static int getLightBlockInto(BlockGetter p_75668_, BlockState p_75669_, BlockPos p_75670_, BlockState p_75671_, BlockPos p_75672_, Direction p_75673_, int p_75674_) -
isSource
protected boolean isSource(long p_75652_)- Specified by:
isSource
in classDynamicGraphMinFixedPoint
-
getComputedLevel
protected int getComputedLevel(long p_75657_, long p_75658_, int p_75659_)- Specified by:
getComputedLevel
in classDynamicGraphMinFixedPoint
-
getLevel
protected int getLevel(long p_75705_)- Specified by:
getLevel
in classDynamicGraphMinFixedPoint
-
getLevel
-
setLevel
protected void setLevel(long p_75654_, int p_75655_)- Specified by:
setLevel
in classDynamicGraphMinFixedPoint
-
computeLevelFromNeighbor
protected int computeLevelFromNeighbor(long p_75696_, long p_75697_, int p_75698_)- Specified by:
computeLevelFromNeighbor
in classDynamicGraphMinFixedPoint
-
hasLightWork
public boolean hasLightWork()- Specified by:
hasLightWork
in interfaceLightEventListener
-
runUpdates
public int runUpdates(int p_75648_, boolean p_75649_, boolean p_75650_)- Specified by:
runUpdates
in interfaceLightEventListener
-
queueSectionData
-
getDataLayerData
- Specified by:
getDataLayerData
in interfaceLayerLightEventListener
-
getLightValue
- Specified by:
getLightValue
in interfaceLayerLightEventListener
-
getDebugData
-
checkBlock
- Specified by:
checkBlock
in interfaceLightEventListener
-
onBlockEmissionIncrease
- Specified by:
onBlockEmissionIncrease
in interfaceLightEventListener
-
updateSectionStatus
- Specified by:
updateSectionStatus
in interfaceLightEventListener
-
enableLightSources
- Specified by:
enableLightSources
in interfaceLightEventListener
-
retainData
-
queuedUpdateSize
public abstract int queuedUpdateSize()- Overrides:
queuedUpdateSize
in classDynamicGraphMinFixedPoint
-