Package net.minecraft.server.level
Class ThreadedLevelLightEngine
java.lang.Object
net.minecraft.world.level.lighting.LevelLightEngine
net.minecraft.server.level.ThreadedLevelLightEngine
- All Implemented Interfaces:
AutoCloseable,LightEventListener
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ChunkMapstatic final intprivate final it.unimi.dsi.fastutil.objects.ObjectList<com.mojang.datafixers.util.Pair<ThreadedLevelLightEngine.TaskType, Runnable>> private static final org.slf4j.Loggerprivate final AtomicBooleanprivate final ProcessorHandle<ChunkTaskPriorityQueueSorter.Message<Runnable>> private final ProcessorMailbox<Runnable> private final intFields inherited from class net.minecraft.world.level.lighting.LevelLightEngine
levelHeightAccessor, LIGHT_SECTION_PADDING -
Constructor Summary
ConstructorsConstructorDescriptionThreadedLevelLightEngine(LightChunkGetter lightChunk, ChunkMap chunkMap, boolean skyLight, ProcessorMailbox<Runnable> taskMailbox, ProcessorHandle<ChunkTaskPriorityQueueSorter.Message<Runnable>> sorterMailbox) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddTask(int chunkX, int chunkZ, IntSupplier queueLevelSupplier, ThreadedLevelLightEngine.TaskType type, Runnable task) private voidaddTask(int chunkX, int chunkZ, ThreadedLevelLightEngine.TaskType type, Runnable task) voidcheckBlock(BlockPos pos) voidclose()initializeLight(ChunkAccess chunk, boolean lightEnabled) lightChunk(ChunkAccess chunk, boolean isLighted) voidpropagateLightSources(ChunkPos chunkPos) voidqueueSectionData(LightLayer lightLayer, SectionPos sectionPos, DataLayer dataLayer) voidretainData(ChunkPos pos, boolean retain) intprivate voidvoidsetLightEnabled(ChunkPos chunkPos, boolean lightEnabled) voidprotected voidupdateChunkStatus(ChunkPos chunkPos) voidupdateSectionStatus(SectionPos pos, boolean isEmpty) waitForPendingTasks(int x, int z) Methods inherited from class net.minecraft.world.level.lighting.LevelLightEngine
getDebugData, getDebugSectionType, getLayerListener, getLightSectionCount, getMaxLightSection, getMinLightSection, getRawBrightness, hasLightWork, lightOnInSectionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.level.lighting.LightEventListener
updateSectionStatus
-
Field Details
-
DEFAULT_BATCH_SIZE
public static final int DEFAULT_BATCH_SIZE- See Also:
-
LOGGER
private static final org.slf4j.Logger LOGGER -
taskMailbox
-
lightTasks
private final it.unimi.dsi.fastutil.objects.ObjectList<com.mojang.datafixers.util.Pair<ThreadedLevelLightEngine.TaskType,Runnable>> lightTasks -
chunkMap
-
sorterMailbox
-
taskPerBatch
private final int taskPerBatch- See Also:
-
scheduled
-
-
Constructor Details
-
ThreadedLevelLightEngine
public ThreadedLevelLightEngine(LightChunkGetter lightChunk, ChunkMap chunkMap, boolean skyLight, ProcessorMailbox<Runnable> taskMailbox, ProcessorHandle<ChunkTaskPriorityQueueSorter.Message<Runnable>> sorterMailbox)
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
runLightUpdates
public int runLightUpdates()- Specified by:
runLightUpdatesin interfaceLightEventListener- Overrides:
runLightUpdatesin classLevelLightEngine
-
checkBlock
- Specified by:
checkBlockin interfaceLightEventListener- Overrides:
checkBlockin classLevelLightEngine
-
updateChunkStatus
-
updateSectionStatus
- Specified by:
updateSectionStatusin interfaceLightEventListener- Overrides:
updateSectionStatusin classLevelLightEngine
-
propagateLightSources
- Specified by:
propagateLightSourcesin interfaceLightEventListener- Overrides:
propagateLightSourcesin classLevelLightEngine
-
setLightEnabled
- Specified by:
setLightEnabledin interfaceLightEventListener- Overrides:
setLightEnabledin classLevelLightEngine
-
queueSectionData
public void queueSectionData(LightLayer lightLayer, SectionPos sectionPos, @Nullable DataLayer dataLayer) - Overrides:
queueSectionDatain classLevelLightEngine
-
addTask
-
addTask
private void addTask(int chunkX, int chunkZ, IntSupplier queueLevelSupplier, ThreadedLevelLightEngine.TaskType type, Runnable task) -
retainData
- Overrides:
retainDatain classLevelLightEngine
-
initializeLight
-
lightChunk
-
tryScheduleUpdate
public void tryScheduleUpdate() -
runUpdate
private void runUpdate() -
waitForPendingTasks
-