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
Fields Modifier and Type Field Description protected IChunkLightProvider
chunkSource
private static Direction[]
DIRECTIONS
private IBlockReader[]
lastChunk
private long[]
lastChunkPos
protected LightType
layer
protected BlockPos.Mutable
pos
private boolean
runningLightUpdates
protected S
storage
-
Constructor Summary
Constructors Constructor Description LightEngine(IChunkLightProvider p_i51296_1_, LightType p_i51296_2_, S p_i51296_3_)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
checkBlock(BlockPos p_215617_1_)
protected void
checkNode(long p_215473_1_)
private void
clearCache()
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_)
NibbleArray
getDataLayerData(SectionPos p_215612_1_)
java.lang.String
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
hasLightWork()
protected boolean
isSource(long p_215485_1_)
void
onBlockEmissionIncrease(BlockPos p_215623_1_, int p_215623_2_)
abstract int
queuedUpdateSize()
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 Detail
-
DIRECTIONS
private static final Direction[] DIRECTIONS
-
chunkSource
protected final IChunkLightProvider chunkSource
-
layer
protected final LightType layer
-
storage
protected final S extends SectionLightStorage<M> storage
-
runningLightUpdates
private boolean runningLightUpdates
-
pos
protected final BlockPos.Mutable pos
-
lastChunkPos
private final long[] lastChunkPos
-
lastChunk
private final IBlockReader[] lastChunk
-
-
Constructor Detail
-
LightEngine
public LightEngine(IChunkLightProvider p_i51296_1_, LightType p_i51296_2_, S p_i51296_3_)
-
-
Method Detail
-
checkNode
protected void checkNode(long p_215473_1_)
- Overrides:
checkNode
in classLevelBasedGraph
-
getChunk
@Nullable private IBlockReader getChunk(int p_215615_1_, int p_215615_2_)
-
clearCache
private void clearCache()
-
getStateAndOpacity
protected BlockState getStateAndOpacity(long p_227468_1_, @Nullable org.apache.commons.lang3.mutable.MutableInt p_227468_3_)
-
getShape
protected VoxelShape getShape(BlockState p_223405_1_, long p_223405_2_, Direction p_223405_4_)
-
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
protected int getLevel(NibbleArray p_215622_1_, long p_215622_2_)
-
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
@Nullable public NibbleArray getDataLayerData(SectionPos p_215612_1_)
- Specified by:
getDataLayerData
in interfaceIWorldLightListener
-
getLightValue
public int getLightValue(BlockPos p_215611_1_)
- Specified by:
getLightValue
in interfaceIWorldLightListener
-
getDebugData
public java.lang.String getDebugData(long p_215614_1_)
-
checkBlock
public void checkBlock(BlockPos p_215617_1_)
-
onBlockEmissionIncrease
public void onBlockEmissionIncrease(BlockPos p_215623_1_, int p_215623_2_)
-
updateSectionStatus
public void updateSectionStatus(SectionPos p_215566_1_, boolean p_215566_2_)
- Specified by:
updateSectionStatus
in interfaceILightListener
-
enableLightSources
public void enableLightSources(ChunkPos p_215620_1_, boolean p_215620_2_)
-
retainData
public void retainData(ChunkPos p_223129_1_, boolean p_223129_2_)
-
queuedUpdateSize
public abstract int queuedUpdateSize()
- Overrides:
queuedUpdateSize
in classLevelBasedGraph
-
-