public class ServerLightingProvider extends LightingProvider implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
ServerLightingProvider.Stage |
| Modifier and Type | Field and Description |
|---|---|
private ThreadedAnvilChunkStorage |
chunkStorage |
private MessageListener<ChunkTaskPrioritySystem.Task<Runnable>> |
executor |
private static Logger |
LOGGER |
private it.unimi.dsi.fastutil.objects.ObjectList<com.mojang.datafixers.util.Pair<ServerLightingProvider.Stage,Runnable>> |
pendingTasks |
private TaskExecutor<Runnable> |
processor |
private int |
taskBatchSize |
private AtomicBoolean |
ticking |
| Constructor and Description |
|---|
ServerLightingProvider(ChunkProvider chunkProvider,
ThreadedAnvilChunkStorage chunkStorage,
boolean hasBlockLight,
TaskExecutor<Runnable> processor,
MessageListener<ChunkTaskPrioritySystem.Task<Runnable>> executor) |
| Modifier and Type | Method and Description |
|---|---|
void |
addLightSource(BlockPos pos,
int level) |
void |
checkBlock(BlockPos pos) |
void |
close() |
int |
doLightUpdates(int maxUpdateCount,
boolean doSkylight,
boolean skipEdgeLightPropagation) |
private void |
enqueue(int x,
int z,
IntSupplier completedLevelSupplier,
ServerLightingProvider.Stage stage,
Runnable task) |
private void |
enqueue(int x,
int z,
ServerLightingProvider.Stage stage,
Runnable task) |
void |
enqueueSectionData(LightType lightType,
ChunkSectionPos pos,
ChunkNibbleArray nibbles,
boolean bool) |
CompletableFuture<Chunk> |
light(Chunk chunk,
boolean excludeBlocks) |
private void |
runTasks() |
void |
setColumnEnabled(ChunkPos pos,
boolean lightEnabled) |
void |
setRetainData(ChunkPos pos,
boolean retainData) |
void |
setSectionStatus(ChunkSectionPos pos,
boolean notReady) |
void |
setTaskBatchSize(int taskBatchSize) |
void |
tick() |
protected void |
updateChunkStatus(ChunkPos pos) |
displaySectionLevel, get, getLight, hasUpdatesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetSectionStatusprivate static final Logger LOGGER
private final TaskExecutor<Runnable> processor
private final it.unimi.dsi.fastutil.objects.ObjectList<com.mojang.datafixers.util.Pair<ServerLightingProvider.Stage,Runnable>> pendingTasks
private final ThreadedAnvilChunkStorage chunkStorage
private final MessageListener<ChunkTaskPrioritySystem.Task<Runnable>> executor
private volatile int taskBatchSize
private final AtomicBoolean ticking
public ServerLightingProvider(ChunkProvider chunkProvider, ThreadedAnvilChunkStorage chunkStorage, boolean hasBlockLight, TaskExecutor<Runnable> processor, MessageListener<ChunkTaskPrioritySystem.Task<Runnable>> executor)
public void close()
close in interface AutoCloseablepublic int doLightUpdates(int maxUpdateCount,
boolean doSkylight,
boolean skipEdgeLightPropagation)
doLightUpdates in class LightingProviderpublic void addLightSource(BlockPos pos, int level)
addLightSource in class LightingProviderpublic void checkBlock(BlockPos pos)
checkBlock in class LightingProviderprotected void updateChunkStatus(ChunkPos pos)
public void setSectionStatus(ChunkSectionPos pos, boolean notReady)
setSectionStatus in interface LightingViewsetSectionStatus in class LightingProviderpublic void setColumnEnabled(ChunkPos pos, boolean lightEnabled)
setColumnEnabled in class LightingProviderpublic void enqueueSectionData(LightType lightType, ChunkSectionPos pos, @Nullable ChunkNibbleArray nibbles, boolean bool)
enqueueSectionData in class LightingProviderprivate void enqueue(int x,
int z,
ServerLightingProvider.Stage stage,
Runnable task)
private void enqueue(int x,
int z,
IntSupplier completedLevelSupplier,
ServerLightingProvider.Stage stage,
Runnable task)
public void setRetainData(ChunkPos pos, boolean retainData)
setRetainData in class LightingProviderpublic CompletableFuture<Chunk> light(Chunk chunk, boolean excludeBlocks)
public void tick()
private void runTasks()
public void setTaskBatchSize(int taskBatchSize)