Class LightEngine<M extends DataLayerStorageMap<M>, S extends LayerLightSectionStorage<M>>
java.lang.Object
net.minecraft.world.level.lighting.LightEngine<M,S>
- All Implemented Interfaces:
LayerLightEventListener, LightEventListener
- Direct Known Subclasses:
BlockLightEngine, SkyLightEngine
public abstract class LightEngine<M extends DataLayerStorageMap<M>, S extends LayerLightSectionStorage<M>>
extends Object
implements LayerLightEventListener
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface LayerLightEventListener
LayerLightEventListener.DummyLightLayerEventListener -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final it.unimi.dsi.fastutil.longs.LongOpenHashSetprivate static final intprotected final LightChunkGetterprivate final it.unimi.dsi.fastutil.longs.LongArrayFIFOQueueprivate final it.unimi.dsi.fastutil.longs.LongArrayFIFOQueueprivate final LightChunk[]private final long[]static final intprotected static final intprivate static final intprotected static final Direction[]protected static final longprotected final S -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckBlock(BlockPos pos) protected abstract voidcheckNode(long blockNode) private voidprotected voidenqueueDecrease(long fromNode, long decreaseData) protected voidenqueueIncrease(long fromNode, long increaseData) protected @Nullable LightChunkgetChunk(int chunkX, int chunkZ) @Nullable DataLayergetDebugData(long sectionNode) getDebugSectionType(long sectionNode) static intgetLightBlockInto(BlockState fromState, BlockState toState, Direction direction, int simpleOpacity) intgetLightValue(BlockPos pos) static VoxelShapegetOcclusionShape(BlockState state, Direction direction) protected intgetOpacity(BlockState state) protected BlockStatestatic booleanhasDifferentLightProperties(BlockState oldState, BlockState newState) Deprecated.Neo: use overload with level context insteadstatic booleanhasDifferentLightProperties(BlockGetter level, BlockPos pos, BlockState oldState, BlockState newState) booleanprotected static booleanisEmptyShape(BlockState state) protected abstract voidpropagateDecrease(long fromNode, long decreaseData) private intprotected abstract voidpropagateIncrease(long fromNode, long increaseData, int fromLevel) private intvoidqueueSectionData(long pos, @Nullable DataLayer data) voidretainData(ChunkPos pos, boolean retain) intvoidsetLightEnabled(ChunkPos pos, boolean enable) protected booleanshapeOccludes(BlockState fromState, BlockState toState, Direction direction) voidupdateSectionStatus(SectionPos pos, boolean sectionEmpty) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface LightEventListener
propagateLightSources, updateSectionStatus
-
Field Details
-
MAX_LEVEL
public static final int MAX_LEVEL- See Also:
-
MIN_OPACITY
protected static final int MIN_OPACITY- See Also:
-
PULL_LIGHT_IN_ENTRY
protected static final long PULL_LIGHT_IN_ENTRY -
MIN_QUEUE_SIZE
private static final int MIN_QUEUE_SIZE- See Also:
-
PROPAGATION_DIRECTIONS
-
chunkSource
-
storage
-
blockNodesToCheck
private final it.unimi.dsi.fastutil.longs.LongOpenHashSet blockNodesToCheck -
decreaseQueue
private final it.unimi.dsi.fastutil.longs.LongArrayFIFOQueue decreaseQueue -
increaseQueue
private final it.unimi.dsi.fastutil.longs.LongArrayFIFOQueue increaseQueue -
CACHE_SIZE
private static final int CACHE_SIZE- See Also:
-
lastChunkPos
private final long[] lastChunkPos -
lastChunk
-
-
Constructor Details
-
LightEngine
-
-
Method Details
-
hasDifferentLightProperties
@Deprecated public static boolean hasDifferentLightProperties(BlockState oldState, BlockState newState) Deprecated.Neo: use overload with level context instead -
hasDifferentLightProperties
public static boolean hasDifferentLightProperties(BlockGetter level, BlockPos pos, BlockState oldState, BlockState newState) -
getLightBlockInto
public static int getLightBlockInto(BlockState fromState, BlockState toState, Direction direction, int simpleOpacity) -
getOcclusionShape
-
isEmptyShape
-
getState
-
getOpacity
-
shapeOccludes
-
getChunk
-
clearChunkCache
private void clearChunkCache() -
checkBlock
- Specified by:
checkBlockin interfaceLightEventListener
-
queueSectionData
-
retainData
-
updateSectionStatus
- Specified by:
updateSectionStatusin interfaceLightEventListener
-
setLightEnabled
- Specified by:
setLightEnabledin interfaceLightEventListener
-
runLightUpdates
public int runLightUpdates()- Specified by:
runLightUpdatesin interfaceLightEventListener
-
propagateIncreases
private int propagateIncreases() -
propagateDecreases
private int propagateDecreases() -
enqueueDecrease
protected void enqueueDecrease(long fromNode, long decreaseData) -
enqueueIncrease
protected void enqueueIncrease(long fromNode, long increaseData) -
hasLightWork
public boolean hasLightWork()- Specified by:
hasLightWorkin interfaceLightEventListener
-
getDataLayerData
- Specified by:
getDataLayerDatain interfaceLayerLightEventListener
-
getLightValue
- Specified by:
getLightValuein interfaceLayerLightEventListener
-
getDebugData
-
getDebugSectionType
-
checkNode
protected abstract void checkNode(long blockNode) -
propagateIncrease
protected abstract void propagateIncrease(long fromNode, long increaseData, int fromLevel) -
propagateDecrease
protected abstract void propagateDecrease(long fromNode, long decreaseData)
-