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 IChunkLightProviderchunkSourceprivate static Direction[]DIRECTIONSprivate IBlockReader[]lastChunkprivate long[]lastChunkPosprotected LightTypelayerprotected BlockPos.Mutableposprivate booleanrunningLightUpdatesprotected Sstorage
-
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 voidcheckBlock(BlockPos p_215617_1_)protected voidcheckNode(long p_215473_1_)private voidclearCache()protected intcomputeLevelFromNeighbor(long p_215480_1_, long p_215480_3_, int p_215480_5_)voidenableLightSources(ChunkPos p_215620_1_, boolean p_215620_2_)private IBlockReadergetChunk(int p_215615_1_, int p_215615_2_)protected intgetComputedLevel(long p_215477_1_, long p_215477_3_, int p_215477_5_)NibbleArraygetDataLayerData(SectionPos p_215612_1_)java.lang.StringgetDebugData(long p_215614_1_)protected intgetLevel(long p_215471_1_)protected intgetLevel(NibbleArray p_215622_1_, long p_215622_2_)static intgetLightBlockInto(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_)intgetLightValue(BlockPos p_215611_1_)protected VoxelShapegetShape(BlockState p_223405_1_, long p_223405_2_, Direction p_223405_4_)protected BlockStategetStateAndOpacity(long p_227468_1_, org.apache.commons.lang3.mutable.MutableInt p_227468_3_)booleanhasLightWork()protected booleanisSource(long p_215485_1_)voidonBlockEmissionIncrease(BlockPos p_215623_1_, int p_215623_2_)abstract intqueuedUpdateSize()protected voidqueueSectionData(long p_215621_1_, NibbleArray p_215621_3_, boolean p_215621_4_)voidretainData(ChunkPos p_223129_1_, boolean p_223129_2_)intrunUpdates(int p_215616_1_, boolean p_215616_2_, boolean p_215616_3_)protected voidsetLevel(long p_215476_1_, int p_215476_3_)voidupdateSectionStatus(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:
checkNodein 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:
isSourcein classLevelBasedGraph
-
getComputedLevel
protected int getComputedLevel(long p_215477_1_, long p_215477_3_, int p_215477_5_)- Specified by:
getComputedLevelin classLevelBasedGraph
-
getLevel
protected int getLevel(long p_215471_1_)
- Specified by:
getLevelin 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:
setLevelin classLevelBasedGraph
-
computeLevelFromNeighbor
protected int computeLevelFromNeighbor(long p_215480_1_, long p_215480_3_, int p_215480_5_)- Specified by:
computeLevelFromNeighborin 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:
getDataLayerDatain interfaceIWorldLightListener
-
getLightValue
public int getLightValue(BlockPos p_215611_1_)
- Specified by:
getLightValuein 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:
updateSectionStatusin 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:
queuedUpdateSizein classLevelBasedGraph
-
-