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 LevelLightEngine
EMPTY, levelHeightAccessor, LIGHT_SECTION_PADDING -
Constructor Summary
ConstructorsConstructorDescriptionThreadedLevelLightEngine(LightChunkGetter lightChunkGetter, ChunkMap chunkMap, boolean hasSkyLight, ConsecutiveExecutor consecutiveExecutor, ChunkTaskDispatcher taskDispatcher) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddTask(int chunkX, int chunkZ, IntSupplier level, ThreadedLevelLightEngine.TaskType type, Runnable runnable) private voidaddTask(int chunkX, int chunkZ, ThreadedLevelLightEngine.TaskType type, Runnable runnable) voidcheckBlock(BlockPos pos) voidclose()initializeLight(ChunkAccess chunk, boolean lighted) lightChunk(ChunkAccess centerChunk, boolean lighted) voidvoidqueueSectionData(LightLayer layer, SectionPos pos, @Nullable DataLayer data) voidretainData(ChunkPos pos, boolean retain) intprivate voidvoidsetLightEnabled(ChunkPos pos, boolean enable) voidprotected voidvoidupdateSectionStatus(SectionPos pos, boolean sectionEmpty) waitForPendingTasks(int chunkX, int chunkZ) Methods inherited from class LevelLightEngine
getDebugData, getDebugSectionType, getLayerListener, getLightSectionCount, getMaxLightSection, getMinLightSection, getRawBrightness, hasLightWork, lightOnInColumnMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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 lightChunkGetter, ChunkMap chunkMap, boolean hasSkyLight, ConsecutiveExecutor consecutiveExecutor, ChunkTaskDispatcher taskDispatcher)
-
-
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
- Overrides:
queueSectionDatain classLevelLightEngine
-
addTask
private void addTask(int chunkX, int chunkZ, ThreadedLevelLightEngine.TaskType type, Runnable runnable) -
addTask
private void addTask(int chunkX, int chunkZ, IntSupplier level, ThreadedLevelLightEngine.TaskType type, Runnable runnable) -
retainData
- Overrides:
retainDatain classLevelLightEngine
-
initializeLight
-
lightChunk
-
tryScheduleUpdate
public void tryScheduleUpdate() -
runUpdate
private void runUpdate() -
waitForPendingTasks
-