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, hasUpdates
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setSectionStatus
private 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 AutoCloseable
public int doLightUpdates(int maxUpdateCount, boolean doSkylight, boolean skipEdgeLightPropagation)
doLightUpdates
in class LightingProvider
public void addLightSource(BlockPos pos, int level)
addLightSource
in class LightingProvider
public void checkBlock(BlockPos pos)
checkBlock
in class LightingProvider
protected void updateChunkStatus(ChunkPos pos)
public void setSectionStatus(ChunkSectionPos pos, boolean notReady)
setSectionStatus
in interface LightingView
setSectionStatus
in class LightingProvider
public void setColumnEnabled(ChunkPos pos, boolean lightEnabled)
setColumnEnabled
in class LightingProvider
public void enqueueSectionData(LightType lightType, ChunkSectionPos pos, @Nullable ChunkNibbleArray nibbles, boolean bool)
enqueueSectionData
in class LightingProvider
private 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 LightingProvider
public CompletableFuture<Chunk> light(Chunk chunk, boolean excludeBlocks)
public void tick()
private void runTasks()
public void setTaskBatchSize(int taskBatchSize)