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) |
CompletableFuture<Chunk> |
light(Chunk chunk,
boolean excludeBlocks) |
void |
queueData(LightType lightType,
ChunkSectionPos pos,
ChunkNibbleArray nibbles) |
private void |
runTasks() |
void |
setLightEnabled(ChunkPos pos,
boolean lightEnabled) |
void |
setRetainData(ChunkPos pos,
boolean retainData) |
void |
setTaskBatchSize(int taskBatchSize) |
void |
tick() |
protected void |
updateChunkStatus(ChunkPos pos) |
void |
updateSectionStatus(ChunkSectionPos pos,
boolean status) |
get, getLight, hasUpdates, method_22876
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
updateSectionStatus
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 updateSectionStatus(ChunkSectionPos pos, boolean status)
updateSectionStatus
in interface LightingView
updateSectionStatus
in class LightingProvider
public void setLightEnabled(ChunkPos pos, boolean lightEnabled)
setLightEnabled
in class LightingProvider
public void queueData(LightType lightType, ChunkSectionPos pos, @Nullable ChunkNibbleArray nibbles)
queueData
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)