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 ChunkMapprivate final ConsecutiveExecutorstatic 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 ChunkTaskDispatcherprivate final intFields inherited from class net.minecraft.world.level.lighting.LevelLightEngine
EMPTY, levelHeightAccessor, LIGHT_SECTION_PADDING -
Constructor Summary
ConstructorsConstructorDescriptionThreadedLevelLightEngine(LightChunkGetter pLightChunkGetter, ChunkMap pChunkMap, boolean pSkyLight, ConsecutiveExecutor pConsecutiveExecutor, ChunkTaskDispatcher pTaskDispatcher) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddTask(int pChunkX, int pChunkZ, IntSupplier pQueueLevelSupplier, ThreadedLevelLightEngine.TaskType pType, Runnable pTask) private voidaddTask(int pChunkX, int pChunkZ, ThreadedLevelLightEngine.TaskType pType, Runnable pTask) voidcheckBlock(BlockPos pPos) voidclose()initializeLight(ChunkAccess pChunk, boolean pLightEnabled) lightChunk(ChunkAccess pChunk, boolean pIsLighted) voidpropagateLightSources(ChunkPos pChunkPos) voidqueueSectionData(LightLayer pLightLayer, SectionPos pSectionPos, DataLayer pDataLayer) voidretainData(ChunkPos pPos, boolean pRetain) intprivate voidvoidsetLightEnabled(ChunkPos pChunkPos, boolean pLightEnabled) voidprotected voidupdateChunkStatus(ChunkPos pChunkPos) voidupdateSectionStatus(SectionPos pPos, boolean pIsEmpty) waitForPendingTasks(int pX, int pZ) Methods inherited from class net.minecraft.world.level.lighting.LevelLightEngine
getDebugData, getDebugSectionType, getLayerListener, getLightSectionCount, getMaxLightSection, getMinLightSection, getRawBrightness, hasLightWork, lightOnInColumnMethods 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 -
consecutiveExecutor
-
lightTasks
private final it.unimi.dsi.fastutil.objects.ObjectList<com.mojang.datafixers.util.Pair<ThreadedLevelLightEngine.TaskType,Runnable>> lightTasks -
chunkMap
-
taskDispatcher
-
taskPerBatch
private final int taskPerBatch- See Also:
-
scheduled
-
-
Constructor Details
-
ThreadedLevelLightEngine
public ThreadedLevelLightEngine(LightChunkGetter pLightChunkGetter, ChunkMap pChunkMap, boolean pSkyLight, ConsecutiveExecutor pConsecutiveExecutor, ChunkTaskDispatcher pTaskDispatcher)
-
-
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 pLightLayer, SectionPos pSectionPos, @Nullable DataLayer pDataLayer) - Overrides:
queueSectionDatain classLevelLightEngine
-
addTask
private void addTask(int pChunkX, int pChunkZ, ThreadedLevelLightEngine.TaskType pType, Runnable pTask) -
addTask
private void addTask(int pChunkX, int pChunkZ, IntSupplier pQueueLevelSupplier, ThreadedLevelLightEngine.TaskType pType, Runnable pTask) -
retainData
- Overrides:
retainDatain classLevelLightEngine
-
initializeLight
-
lightChunk
-
tryScheduleUpdate
public void tryScheduleUpdate() -
runUpdate
private void runUpdate() -
waitForPendingTasks
-