Package net.minecraft.server.world
Class ServerLightingProvider
java.lang.Object
net.minecraft.world.chunk.light.LightingProvider
net.minecraft.server.world.ServerLightingProvider
- All Implemented Interfaces:
AutoCloseable,LightingView
public class ServerLightingProvider extends LightingProvider implements AutoCloseable
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classServerLightingProvider.Stage -
Field Summary
Fields Modifier and Type Field Description private ThreadedAnvilChunkStoragechunkStorageprivate MessageListener<ChunkTaskPrioritySystem.Task<Runnable>>executorprivate static LoggerLOGGERprivate ObjectList<com.mojang.datafixers.util.Pair<ServerLightingProvider.Stage,Runnable>>pendingTasksprivate TaskExecutor<Runnable>processorprivate inttaskBatchSizeprivate AtomicBooleanticking -
Constructor Summary
Constructors Constructor Description ServerLightingProvider(ChunkProvider chunkProvider, ThreadedAnvilChunkStorage chunkStorage, boolean hasBlockLight, TaskExecutor<Runnable> processor, MessageListener<ChunkTaskPrioritySystem.Task<Runnable>> executor) -
Method Summary
Modifier and Type Method Description voidaddLightSource(BlockPos pos, int level)voidcheckBlock(BlockPos pos)voidclose()intdoLightUpdates(int maxUpdateCount, boolean doSkylight, boolean skipEdgeLightPropagation)private voidenqueue(int x, int z, IntSupplier completedLevelSupplier, ServerLightingProvider.Stage stage, Runnable task)private voidenqueue(int x, int z, ServerLightingProvider.Stage stage, Runnable task)CompletableFuture<Chunk>light(Chunk chunk, boolean excludeBlocks)voidqueueData(LightType lightType, ChunkSectionPos pos, ChunkNibbleArray nibbles, boolean bool)private voidrunTasks()voidsetLightEnabled(ChunkPos pos, boolean lightEnabled)voidsetRetainData(ChunkPos pos, boolean retainData)voidsetTaskBatchSize(int taskBatchSize)voidtick()protected voidupdateChunkStatus(ChunkPos pos)voidupdateSectionStatus(ChunkSectionPos pos, boolean status)Methods inherited from class net.minecraft.world.chunk.light.LightingProvider
get, getLight, hasUpdates, method_22876
-
Field Details
-
LOGGER
-
processor
-
pendingTasks
private final ObjectList<com.mojang.datafixers.util.Pair<ServerLightingProvider.Stage,Runnable>> pendingTasks -
chunkStorage
-
executor
-
taskBatchSize
private volatile int taskBatchSize -
ticking
-
-
Constructor Details
-
ServerLightingProvider
public ServerLightingProvider(ChunkProvider chunkProvider, ThreadedAnvilChunkStorage chunkStorage, boolean hasBlockLight, TaskExecutor<Runnable> processor, MessageListener<ChunkTaskPrioritySystem.Task<Runnable>> executor)
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
doLightUpdates
public int doLightUpdates(int maxUpdateCount, boolean doSkylight, boolean skipEdgeLightPropagation)- Overrides:
doLightUpdatesin classLightingProvider
-
addLightSource
- Overrides:
addLightSourcein classLightingProvider
-
checkBlock
- Overrides:
checkBlockin classLightingProvider
-
updateChunkStatus
-
updateSectionStatus
- Specified by:
updateSectionStatusin interfaceLightingView- Overrides:
updateSectionStatusin classLightingProvider
-
setLightEnabled
- Overrides:
setLightEnabledin classLightingProvider
-
queueData
public void queueData(LightType lightType, ChunkSectionPos pos, @Nullable ChunkNibbleArray nibbles, boolean bool)- Overrides:
queueDatain classLightingProvider
-
enqueue
-
enqueue
private void enqueue(int x, int z, IntSupplier completedLevelSupplier, ServerLightingProvider.Stage stage, Runnable task) -
setRetainData
- Overrides:
setRetainDatain classLightingProvider
-
light
-
tick
public void tick() -
runTasks
private void runTasks() -
setTaskBatchSize
public void setTaskBatchSize(int taskBatchSize)
-