Class TaskScreen

All Implemented Interfaces:
Drawable, Element, Navigable, ParentElement

@Environment(CLIENT) public class TaskScreen extends Screen
A screen that is used for indicating that a task is running or has finished running (either successfully or unsuccessfully). The screen has an optional multi-line description and a button which can be used to close the screen. The button can have a cooldown, which disables the button for a while after the screen is displayed.
Mappings:
Namespace Name
named net/minecraft/client/gui/screen/TaskScreen
intermediary net/minecraft/class_7534
official fty
  • Field Details Link icon

    • TITLE_TEXT_Y Link icon

      private static final int TITLE_TEXT_Y
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named TITLE_TEXT_Y Lnet/minecraft/client/gui/screen/TaskScreen;TITLE_TEXT_Y:I
      intermediary field_39541 Lnet/minecraft/class_7534;field_39541:I
      official a Lfty;a:I
    • DESCRIPTION_TEXT_Y Link icon

      private static final int DESCRIPTION_TEXT_Y
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named DESCRIPTION_TEXT_Y Lnet/minecraft/client/gui/screen/TaskScreen;DESCRIPTION_TEXT_Y:I
      intermediary field_39542 Lnet/minecraft/class_7534;field_39542:I
      official b Lfty;b:I
    • DESCRIPTION_TEXT_WIDTH Link icon

      private static final int DESCRIPTION_TEXT_WIDTH
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named DESCRIPTION_TEXT_WIDTH Lnet/minecraft/client/gui/screen/TaskScreen;DESCRIPTION_TEXT_WIDTH:I
      intermediary field_39543 Lnet/minecraft/class_7534;field_39543:I
      official c Lfty;c:I
    • descriptionText Link icon

      @Nullable private final @Nullable Text descriptionText
      Mappings:
      Namespace Name Mixin selector
      named descriptionText Lnet/minecraft/client/gui/screen/TaskScreen;descriptionText:Lnet/minecraft/text/Text;
      intermediary field_39745 Lnet/minecraft/class_7534;field_39745:Lnet/minecraft/class_2561;
      official d Lfty;d:Lwp;
    • closeButtonText Link icon

      private final Text closeButtonText
      Mappings:
      Namespace Name Mixin selector
      named closeButtonText Lnet/minecraft/client/gui/screen/TaskScreen;closeButtonText:Lnet/minecraft/text/Text;
      intermediary field_39544 Lnet/minecraft/class_7534;field_39544:Lnet/minecraft/class_2561;
      official s Lfty;s:Lwp;
    • closeCallback Link icon

      private final Runnable closeCallback
      The callback executed when the button or the Esc key is pressed. This can have a side effect, such as cancelling a task in progress.
      Mappings:
      Namespace Name Mixin selector
      named closeCallback Lnet/minecraft/client/gui/screen/TaskScreen;closeCallback:Ljava/lang/Runnable;
      intermediary field_39545 Lnet/minecraft/class_7534;field_39545:Ljava/lang/Runnable;
      official u Lfty;u:Ljava/lang/Runnable;
    • description Link icon

      @Nullable private @Nullable MultilineText description
      Mappings:
      Namespace Name Mixin selector
      named description Lnet/minecraft/client/gui/screen/TaskScreen;description:Lnet/minecraft/client/font/MultilineText;
      intermediary field_39546 Lnet/minecraft/class_7534;field_39546:Lnet/minecraft/class_5489;
      official v Lfty;v:Lfpn;
    • button Link icon

      private ButtonWidget button
      The button to close the screen (potentially with a side effect, such as cancelling a task).
      Mappings:
      Namespace Name Mixin selector
      named button Lnet/minecraft/client/gui/screen/TaskScreen;button:Lnet/minecraft/client/gui/widget/ButtonWidget;
      intermediary field_39547 Lnet/minecraft/class_7534;field_39547:Lnet/minecraft/class_4185;
      official w Lfty;w:Lfou;
    • buttonCooldown Link icon

      private int buttonCooldown
      How long the button should be disabled after the screen is displayed in ticks. Can be disabled by setting to 0.
      Mappings:
      Namespace Name Mixin selector
      named buttonCooldown Lnet/minecraft/client/gui/screen/TaskScreen;buttonCooldown:I
      intermediary field_39746 Lnet/minecraft/class_7534;field_39746:I
      official x Lfty;x:I
  • Constructor Details Link icon

    • TaskScreen Link icon

      protected TaskScreen(Text title, @Nullable @Nullable Text descriptionText, Text closeButtonText, Runnable closeCallback, int buttonCooldown)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/client/gui/screen/TaskScreen;<init>(Lnet/minecraft/text/Text;Lnet/minecraft/text/Text;Lnet/minecraft/text/Text;Ljava/lang/Runnable;I)V
      intermediary <init> Lnet/minecraft/class_7534;<init>(Lnet/minecraft/class_2561;Lnet/minecraft/class_2561;Lnet/minecraft/class_2561;Ljava/lang/Runnable;I)V
      official <init> Lfty;<init>(Lwp;Lwp;Lwp;Ljava/lang/Runnable;I)V
  • Method Details Link icon

    • createRunningScreen Link icon

      public static TaskScreen createRunningScreen(Text title, Text closeButtonText, Runnable closeCallback)
      Returns a new screen to indicate a task is running.

      The screen has no description or button cooldown.

      Returns:
      a new screen to indicate a task is running
      Mappings:
      Namespace Name Mixin selector
      named createRunningScreen Lnet/minecraft/client/gui/screen/TaskScreen;createRunningScreen(Lnet/minecraft/text/Text;Lnet/minecraft/text/Text;Ljava/lang/Runnable;)Lnet/minecraft/client/gui/screen/TaskScreen;
      intermediary method_44690 Lnet/minecraft/class_7534;method_44690(Lnet/minecraft/class_2561;Lnet/minecraft/class_2561;Ljava/lang/Runnable;)Lnet/minecraft/class_7534;
      official a Lfty;a(Lwp;Lwp;Ljava/lang/Runnable;)Lfty;
    • createResultScreen Link icon

      public static TaskScreen createResultScreen(Text title, Text descriptionText, Text closeButtonText, Runnable closeCallback)
      Returns a new screen to indicate a task has finished running.

      The screen has a button cooldown of 20 ticks (1 second).

      Returns:
      a new screen to indicate a task has finished running
      Mappings:
      Namespace Name Mixin selector
      named createResultScreen Lnet/minecraft/client/gui/screen/TaskScreen;createResultScreen(Lnet/minecraft/text/Text;Lnet/minecraft/text/Text;Lnet/minecraft/text/Text;Ljava/lang/Runnable;)Lnet/minecraft/client/gui/screen/TaskScreen;
      intermediary method_44691 Lnet/minecraft/class_7534;method_44691(Lnet/minecraft/class_2561;Lnet/minecraft/class_2561;Lnet/minecraft/class_2561;Ljava/lang/Runnable;)Lnet/minecraft/class_7534;
      official a Lfty;a(Lwp;Lwp;Lwp;Ljava/lang/Runnable;)Lfty;
    • init Link icon

      protected void init()
      Called when a screen should be initialized.

      This method is called when this screen is opened or resized.

      Overrides:
      init in class Screen
      Mappings:
      Namespace Name Mixin selector
      named init Lnet/minecraft/client/gui/screen/Screen;init()V
      intermediary method_25426 Lnet/minecraft/class_437;method_25426()V
      official aR_ Lfum;aR_()V
    • tick Link icon

      public void tick()
      Overrides:
      tick in class Screen
      Mappings:
      Namespace Name Mixin selector
      named tick Lnet/minecraft/client/gui/screen/Screen;tick()V
      intermediary method_25393 Lnet/minecraft/class_437;method_25393()V
      official e Lfum;e()V
    • render Link icon

      public void render(DrawContext context, int mouseX, int mouseY, float delta)
      Specified by:
      render in interface Drawable
      Overrides:
      render in class Screen
      Mappings:
      Namespace Name Mixin selector
      named render Lnet/minecraft/client/gui/Drawable;render(Lnet/minecraft/client/gui/DrawContext;IIF)V
      intermediary method_25394 Lnet/minecraft/class_4068;method_25394(Lnet/minecraft/class_332;IIF)V
      official a Lfpx;a(Lfof;IIF)V
    • shouldCloseOnEsc Link icon

      public boolean shouldCloseOnEsc()
      Checks whether this screen should be closed when the escape key is pressed.
      Overrides:
      shouldCloseOnEsc in class Screen
      Mappings:
      Namespace Name Mixin selector
      named shouldCloseOnEsc Lnet/minecraft/client/gui/screen/Screen;shouldCloseOnEsc()Z
      intermediary method_25422 Lnet/minecraft/class_437;method_25422()Z
      official aG_ Lfum;aG_()Z
    • close Link icon

      public void close()
      Overrides:
      close in class Screen
      Mappings:
      Namespace Name Mixin selector
      named close Lnet/minecraft/client/gui/screen/Screen;close()V
      intermediary method_25419 Lnet/minecraft/class_437;method_25419()V
      official aO_ Lfum;aO_()V
    • getNarratedTitle Link icon

      public Text getNarratedTitle()
      Overrides:
      getNarratedTitle in class Screen
      Mappings:
      Namespace Name Mixin selector
      named getNarratedTitle Lnet/minecraft/client/gui/screen/Screen;getNarratedTitle()Lnet/minecraft/text/Text;
      intermediary method_25435 Lnet/minecraft/class_437;method_25435()Lnet/minecraft/class_2561;
      official i Lfum;i()Lwp;