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 ChunkMap
static final int
private final it.unimi.dsi.fastutil.objects.ObjectList
<com.mojang.datafixers.util.Pair<ThreadedLevelLightEngine.TaskType, Runnable>> private static final org.slf4j.Logger
private final AtomicBoolean
private final ProcessorHandle
<ChunkTaskPriorityQueueSorter.Message<Runnable>> private final ProcessorMailbox
<Runnable> private final int
Fields 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 void
addTask
(int chunkX, int chunkZ, IntSupplier queueLevelSupplier, ThreadedLevelLightEngine.TaskType type, Runnable task) private void
addTask
(int chunkX, int chunkZ, ThreadedLevelLightEngine.TaskType type, Runnable task) void
checkBlock
(BlockPos pos) void
close()
initializeLight
(ChunkAccess chunk, boolean lightEnabled) lightChunk
(ChunkAccess chunk, boolean isLighted) void
propagateLightSources
(ChunkPos chunkPos) void
queueSectionData
(LightLayer lightLayer, SectionPos sectionPos, DataLayer dataLayer) void
retainData
(ChunkPos pos, boolean retain) int
private void
void
setLightEnabled
(ChunkPos chunkPos, boolean lightEnabled) void
protected void
updateChunkStatus
(ChunkPos chunkPos) void
updateSectionStatus
(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, lightOnInSection
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.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:
close
in interfaceAutoCloseable
-
runLightUpdates
public int runLightUpdates()- Specified by:
runLightUpdates
in interfaceLightEventListener
- Overrides:
runLightUpdates
in classLevelLightEngine
-
checkBlock
- Specified by:
checkBlock
in interfaceLightEventListener
- Overrides:
checkBlock
in classLevelLightEngine
-
updateChunkStatus
-
updateSectionStatus
- Specified by:
updateSectionStatus
in interfaceLightEventListener
- Overrides:
updateSectionStatus
in classLevelLightEngine
-
propagateLightSources
- Specified by:
propagateLightSources
in interfaceLightEventListener
- Overrides:
propagateLightSources
in classLevelLightEngine
-
setLightEnabled
- Specified by:
setLightEnabled
in interfaceLightEventListener
- Overrides:
setLightEnabled
in classLevelLightEngine
-
queueSectionData
public void queueSectionData(LightLayer lightLayer, SectionPos sectionPos, @Nullable DataLayer dataLayer) - Overrides:
queueSectionData
in classLevelLightEngine
-
addTask
-
addTask
private void addTask(int chunkX, int chunkZ, IntSupplier queueLevelSupplier, ThreadedLevelLightEngine.TaskType type, Runnable task) -
retainData
- Overrides:
retainData
in classLevelLightEngine
-
initializeLight
-
lightChunk
-
tryScheduleUpdate
public void tryScheduleUpdate() -
runUpdate
private void runUpdate() -
waitForPendingTasks
-