Package net.minecraft.server.level
Class ChunkTaskPriorityQueueSorter
java.lang.Object
net.minecraft.server.level.ChunkTaskPriorityQueueSorter
- All Implemented Interfaces:
AutoCloseable
,ChunkHolder.LevelChangeListener
public class ChunkTaskPriorityQueueSorter
extends Object
implements ChunkHolder.LevelChangeListener, AutoCloseable
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static final class
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
private final ProcessorMailbox
<StrictQueue.IntRunnable> private final Map
<ProcessorHandle<?>, ChunkTaskPriorityQueue<? extends Function<ProcessorHandle<Unit>, ?>>> private final Set
<ProcessorHandle<?>> -
Constructor Summary
ConstructorDescriptionChunkTaskPriorityQueueSorter
(List<ProcessorHandle<?>> p_140555_, Executor p_140556_, int p_140557_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
getProcessor
(ProcessorHandle<T> p_140605_, boolean p_140606_) private <T> ChunkTaskPriorityQueue
<Function<ProcessorHandle<Unit>, T>> getQueue
(ProcessorHandle<T> p_140653_) getReleaseProcessor
(ProcessorHandle<Runnable> p_140568_) boolean
hasWork()
message
(Runnable p_140625_, long p_140626_, IntSupplier p_140627_) static <T> ChunkTaskPriorityQueueSorter.Message
<T> message
(Function<ProcessorHandle<Unit>, T> p_143182_, long p_143183_, IntSupplier p_143184_) message
(ChunkHolder p_140643_, Runnable p_140644_) static <T> ChunkTaskPriorityQueueSorter.Message
<T> message
(ChunkHolder p_143157_, Function<ProcessorHandle<Unit>, T> p_143158_) void
onLevelChange
(ChunkPos p_140616_, IntSupplier p_140617_, int p_140618_, IntConsumer p_140619_) private <T> void
pollTask
(ChunkTaskPriorityQueue<Function<ProcessorHandle<Unit>, T>> p_140646_, ProcessorHandle<T> p_140647_) private <T> void
release
(ProcessorHandle<T> p_140570_, long p_140571_, Runnable p_140572_, boolean p_140573_) private <T> void
submit
(ProcessorHandle<T> p_140590_, Function<ProcessorHandle<Unit>, T> p_140591_, long p_140592_, IntSupplier p_140593_, boolean p_140594_)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
queues
private final Map<ProcessorHandle<?>,ChunkTaskPriorityQueue<? extends Function<ProcessorHandle<Unit>, queues?>>> -
sleeping
-
mailbox
-
-
Constructor Details
-
ChunkTaskPriorityQueueSorter
public ChunkTaskPriorityQueueSorter(List<ProcessorHandle<?>> p_140555_, Executor p_140556_, int p_140557_)
-
-
Method Details
-
hasWork
public boolean hasWork() -
message
public static <T> ChunkTaskPriorityQueueSorter.Message<T> message(Function<ProcessorHandle<Unit>, T> p_143182_, long p_143183_, IntSupplier p_143184_) -
message
public static ChunkTaskPriorityQueueSorter.Message<Runnable> message(Runnable p_140625_, long p_140626_, IntSupplier p_140627_) -
message
public static ChunkTaskPriorityQueueSorter.Message<Runnable> message(ChunkHolder p_140643_, Runnable p_140644_) -
message
public static <T> ChunkTaskPriorityQueueSorter.Message<T> message(ChunkHolder p_143157_, Function<ProcessorHandle<Unit>, T> p_143158_) -
release
public static ChunkTaskPriorityQueueSorter.Release release(Runnable p_140629_, long p_140630_, boolean p_140631_) -
getProcessor
public <T> ProcessorHandle<ChunkTaskPriorityQueueSorter.Message<T>> getProcessor(ProcessorHandle<T> p_140605_, boolean p_140606_) -
getReleaseProcessor
public ProcessorHandle<ChunkTaskPriorityQueueSorter.Release> getReleaseProcessor(ProcessorHandle<Runnable> p_140568_) -
onLevelChange
public void onLevelChange(ChunkPos p_140616_, IntSupplier p_140617_, int p_140618_, IntConsumer p_140619_) - Specified by:
onLevelChange
in interfaceChunkHolder.LevelChangeListener
-
release
private <T> void release(ProcessorHandle<T> p_140570_, long p_140571_, Runnable p_140572_, boolean p_140573_) -
submit
private <T> void submit(ProcessorHandle<T> p_140590_, Function<ProcessorHandle<Unit>, T> p_140591_, long p_140592_, IntSupplier p_140593_, boolean p_140594_) -
pollTask
private <T> void pollTask(ChunkTaskPriorityQueue<Function<ProcessorHandle<Unit>, T>> p_140646_, ProcessorHandle<T> p_140647_) -
getQueue
private <T> ChunkTaskPriorityQueue<Function<ProcessorHandle<Unit>,T>> getQueue(ProcessorHandle<T> p_140653_) -
getDebugStatus
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-