Package net.minecraft.world.lighting
Class LightEngine<M extends LightDataMap<M>,S extends SectionLightStorage<M>>
java.lang.Object
net.minecraft.world.lighting.LevelBasedGraph
net.minecraft.world.lighting.LightEngine<M,S>
- All Implemented Interfaces:
ILightListener
,IWorldLightListener
- Direct Known Subclasses:
BlockLightEngine
,SkyLightEngine
public abstract class LightEngine<M extends LightDataMap<M>,S extends SectionLightStorage<M>>
extends LevelBasedGraph
implements IWorldLightListener
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.lighting.IWorldLightListener
IWorldLightListener.Dummy
-
Field Summary
Modifier and TypeFieldDescriptionprotected final IChunkLightProvider
private static final Direction[]
private final IBlockReader[]
private final long[]
protected final LightType
protected final BlockPos.Mutable
private boolean
protected final S
-
Constructor Summary
ConstructorDescriptionLightEngine
(IChunkLightProvider p_i51296_1_, LightType p_i51296_2_, S p_i51296_3_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkBlock
(BlockPos p_215617_1_) protected void
checkNode
(long p_215473_1_) private void
protected int
computeLevelFromNeighbor
(long p_215480_1_, long p_215480_3_, int p_215480_5_) void
enableLightSources
(ChunkPos p_215620_1_, boolean p_215620_2_) private IBlockReader
getChunk
(int p_215615_1_, int p_215615_2_) protected int
getComputedLevel
(long p_215477_1_, long p_215477_3_, int p_215477_5_) getDataLayerData
(SectionPos p_215612_1_) getDebugData
(long p_215614_1_) protected int
getLevel
(long p_215471_1_) protected int
getLevel
(NibbleArray p_215622_1_, long p_215622_2_) static int
getLightBlockInto
(IBlockReader p_215613_0_, BlockState p_215613_1_, BlockPos p_215613_2_, BlockState p_215613_3_, BlockPos p_215613_4_, Direction p_215613_5_, int p_215613_6_) int
getLightValue
(BlockPos p_215611_1_) protected VoxelShape
getShape
(BlockState p_223405_1_, long p_223405_2_, Direction p_223405_4_) protected BlockState
getStateAndOpacity
(long p_227468_1_, org.apache.commons.lang3.mutable.MutableInt p_227468_3_) boolean
protected boolean
isSource
(long p_215485_1_) void
onBlockEmissionIncrease
(BlockPos p_215623_1_, int p_215623_2_) abstract int
protected void
queueSectionData
(long p_215621_1_, NibbleArray p_215621_3_, boolean p_215621_4_) void
retainData
(ChunkPos p_223129_1_, boolean p_223129_2_) int
runUpdates
(int p_215616_1_, boolean p_215616_2_, boolean p_215616_3_) protected void
setLevel
(long p_215476_1_, int p_215476_3_) void
updateSectionStatus
(SectionPos p_215566_1_, boolean p_215566_2_) Methods inherited from class net.minecraft.world.lighting.LevelBasedGraph
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.lighting.ILightListener
updateSectionStatus
-
Field Details
-
DIRECTIONS
-
chunkSource
-
layer
-
storage
-
runningLightUpdates
private boolean runningLightUpdates -
pos
-
lastChunkPos
private final long[] lastChunkPos -
lastChunk
-
-
Constructor Details
-
LightEngine
-
-
Method Details
-
checkNode
protected void checkNode(long p_215473_1_) - Overrides:
checkNode
in classLevelBasedGraph
-
getChunk
-
clearCache
private void clearCache() -
getStateAndOpacity
protected BlockState getStateAndOpacity(long p_227468_1_, @Nullable org.apache.commons.lang3.mutable.MutableInt p_227468_3_) -
getShape
-
getLightBlockInto
public static int getLightBlockInto(IBlockReader p_215613_0_, BlockState p_215613_1_, BlockPos p_215613_2_, BlockState p_215613_3_, BlockPos p_215613_4_, Direction p_215613_5_, int p_215613_6_) -
isSource
protected boolean isSource(long p_215485_1_) - Specified by:
isSource
in classLevelBasedGraph
-
getComputedLevel
protected int getComputedLevel(long p_215477_1_, long p_215477_3_, int p_215477_5_) - Specified by:
getComputedLevel
in classLevelBasedGraph
-
getLevel
protected int getLevel(long p_215471_1_) - Specified by:
getLevel
in classLevelBasedGraph
-
getLevel
-
setLevel
protected void setLevel(long p_215476_1_, int p_215476_3_) - Specified by:
setLevel
in classLevelBasedGraph
-
computeLevelFromNeighbor
protected int computeLevelFromNeighbor(long p_215480_1_, long p_215480_3_, int p_215480_5_) - Specified by:
computeLevelFromNeighbor
in classLevelBasedGraph
-
hasLightWork
public boolean hasLightWork() -
runUpdates
public int runUpdates(int p_215616_1_, boolean p_215616_2_, boolean p_215616_3_) -
queueSectionData
protected void queueSectionData(long p_215621_1_, @Nullable NibbleArray p_215621_3_, boolean p_215621_4_) -
getDataLayerData
- Specified by:
getDataLayerData
in interfaceIWorldLightListener
-
getLightValue
- Specified by:
getLightValue
in interfaceIWorldLightListener
-
getDebugData
-
checkBlock
-
onBlockEmissionIncrease
-
updateSectionStatus
- Specified by:
updateSectionStatus
in interfaceILightListener
-
enableLightSources
-
retainData
-
queuedUpdateSize
public abstract int queuedUpdateSize()- Overrides:
queuedUpdateSize
in classLevelBasedGraph
-