Class PendingTaskRunner

java.lang.Object
net.minecraft.util.PendingTaskRunner

public class PendingTaskRunner extends Object
A runner for tasks that can hold only one pending task. It replaces the current pending task if a new one is queued, but does not halt already running tasks.

The runner needs to be updated by tick(), which checks if the running task is done and polls the pending task. queue(net.minecraft.util.PendingTaskRunner.FutureRunnable) sets the pending task for running.

Mappings:
Namespace Name
official rk
intermediary net/minecraft/class_7493
named net/minecraft/util/PendingTaskRunner
  • Field Details

    • pending

      Mappings:
      Namespace Name Mixin selector
      official a Lrk;a:Ljava/util/concurrent/atomic/AtomicReference;
      intermediary field_39442 Lnet/minecraft/class_7493;field_39442:Ljava/util/concurrent/atomic/AtomicReference;
      named pending Lnet/minecraft/util/PendingTaskRunner;pending:Ljava/util/concurrent/atomic/AtomicReference;
    • running

      Mappings:
      Namespace Name Mixin selector
      official b Lrk;b:Ljava/util/concurrent/CompletableFuture;
      intermediary field_39443 Lnet/minecraft/class_7493;field_39443:Ljava/util/concurrent/CompletableFuture;
      named running Lnet/minecraft/util/PendingTaskRunner;running:Ljava/util/concurrent/CompletableFuture;
  • Constructor Details

    • PendingTaskRunner

      public PendingTaskRunner()
  • Method Details

    • tick

      public void tick()
      Waits for the running task to finish and polls the pending task if there is no running task.
      Mappings:
      Namespace Name Mixin selector
      official a Lrk;a()V
      intermediary method_44122 Lnet/minecraft/class_7493;method_44122()V
      named tick Lnet/minecraft/util/PendingTaskRunner;tick()V
    • poll

      private void poll()
      Mappings:
      Namespace Name Mixin selector
      official b Lrk;b()V
      intermediary method_44307 Lnet/minecraft/class_7493;method_44307()V
      named poll Lnet/minecraft/util/PendingTaskRunner;poll()V
    • queue

      public void queue(PendingTaskRunner.FutureRunnable task)
      Queues a task for running, and replaces any existing pending task.
      API Note:
      This method can be called asynchronously, such as from the netty event loop.
      Mappings:
      Namespace Name Mixin selector
      official a Lrk;a(Lrk$a;)V
      intermediary method_44306 Lnet/minecraft/class_7493;method_44306(Lnet/minecraft/class_7493$class_7518;)V
      named queue Lnet/minecraft/util/PendingTaskRunner;queue(Lnet/minecraft/util/PendingTaskRunner$FutureRunnable;)V