Class PendingTaskRunner

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

public class PendingTaskRunner extends Object
A runner for tasks that have a running state and can hold one pending task.

If there is no running tasks, calling run(java.lang.Runnable) will run the passed task and marks the runner as running. During this state, calling the run method will set the task as pending. If called multiple times, only the last task will be called. Calling runPending() forces it to run the pending task, if any.

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

    • running

      private boolean running
      Mappings:
      Namespace Name Mixin selector
      official a Lrg;a:Z
      intermediary field_39385 Lnet/minecraft/class_7493;field_39385:Z
      named running Lnet/minecraft/util/PendingTaskRunner;running:Z
    • pending

      @Nullable private @Nullable Runnable pending
      Mappings:
      Namespace Name Mixin selector
      official b Lrg;b:Ljava/lang/Runnable;
      intermediary field_39386 Lnet/minecraft/class_7493;field_39386:Ljava/lang/Runnable;
      named pending Lnet/minecraft/util/PendingTaskRunner;pending:Ljava/lang/Runnable;
  • Constructor Details

    • PendingTaskRunner

      public PendingTaskRunner()
  • Method Details

    • runPending

      public void runPending()
      Runs the pending task, if any, and marks the runner as not running.
      Mappings:
      Namespace Name Mixin selector
      official a Lrg;a()V
      intermediary method_44122 Lnet/minecraft/class_7493;method_44122()V
      named runPending Lnet/minecraft/util/PendingTaskRunner;runPending()V
    • run

      public void run(Runnable task)
      Runs the task and marks the runner as running if there is no running task, otherwise sets the task as the pending task. This overwrites the old pending task.
      Mappings:
      Namespace Name Mixin selector
      official a Lrg;a(Ljava/lang/Runnable;)V
      intermediary method_44123 Lnet/minecraft/class_7493;method_44123(Ljava/lang/Runnable;)V
      named run Lnet/minecraft/util/PendingTaskRunner;run(Ljava/lang/Runnable;)V