Package net.minecraft.client.gui.screen
Class TaskScreen
java.lang.Object
net.minecraft.client.gui.AbstractParentElement
net.minecraft.client.gui.screen.Screen
net.minecraft.client.gui.screen.TaskScreen
- All Implemented Interfaces:
Drawable,Element,Navigable,ParentElement
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 intermediary net/minecraft/class_7534official etonamed net/minecraft/client/gui/screen/TaskScreen
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.client.gui.screen.Screen
Screen.SelectedElementNarrationData -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ButtonWidgetThe button to close the screen (potentially with a side effect, such as cancelling a task).private intHow long the button should be disabled after the screen is displayed in ticks.private final Textprivate final RunnableThe callback executed when the button or the Esc key is pressed.private @Nullable MultilineTextprivate static final intprivate static final intprivate static final intFields inherited from class net.minecraft.client.gui.screen.Screen
client, height, OPTIONS_BACKGROUND_TEXTURE, textRenderer, title, widthFields inherited from interface net.minecraft.client.gui.Element
MAX_DOUBLE_CLICK_INTERVAL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static TaskScreencreateResultScreen(Text title, Text descriptionText, Text closeButtonText, Runnable closeCallback) Returns a new screen to indicate a task has finished running.static TaskScreencreateRunningScreen(Text title, Text closeButtonText, Runnable closeCallback) Returns a new screen to indicate a task is running.protected voidinit()Called when a screen should be initialized.voidrender(DrawContext context, int mouseX, int mouseY, float delta) booleanChecks whether this screen should be closed when the escape key is pressed.voidtick()Methods inherited from class net.minecraft.client.gui.screen.Screen
addDrawable, addDrawableChild, addElementNarrations, addScreenNarrations, addSelectableChild, applyKeyPressNarratorDelay, applyMouseMoveNarratorDelay, applyMousePressScrollNarratorDelay, applyNarratorModeChangeDelay, children, clearAndInit, clearChildren, filesDragged, findSelectedElementData, getMusic, getNavigationFocus, getTitle, getTooltipFromItem, handleTextClick, hasAltDown, hasControlDown, hasShiftDown, hasUsageText, hide, init, initTabNavigation, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, keyPressed, narrateScreenIfNarrationEnabled, onDisplayed, remove, removed, renderBackground, renderBackgroundTexture, renderWithTooltip, resize, setInitialFocus, setTooltip, setTooltip, setTooltip, setTooltip, shouldPause, switchFocus, updateNarrator, wrapScreenErrorMethods inherited from class net.minecraft.client.gui.AbstractParentElement
getFocused, isDragging, setDragging, setFocusedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.Element
mouseMovedMethods inherited from interface net.minecraft.client.gui.navigation.Navigable
getNavigationOrderMethods inherited from interface net.minecraft.client.gui.ParentElement
charTyped, focusOn, getFocusedPath, getNavigationPath, hoveredElement, isFocused, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, setFocused
-
Field Details
-
TITLE_TEXT_Y
private static final int TITLE_TEXT_Y- See Also:
- Mappings:
Namespace Name Mixin selector intermediary field_39541Lnet/minecraft/class_7534;field_39541:Iofficial aLeto;a:Inamed TITLE_TEXT_YLnet/minecraft/client/gui/screen/TaskScreen;TITLE_TEXT_Y:I
-
DESCRIPTION_TEXT_Y
private static final int DESCRIPTION_TEXT_Y- See Also:
- Mappings:
Namespace Name Mixin selector intermediary field_39542Lnet/minecraft/class_7534;field_39542:Iofficial bLeto;b:Inamed DESCRIPTION_TEXT_YLnet/minecraft/client/gui/screen/TaskScreen;DESCRIPTION_TEXT_Y:I
-
DESCRIPTION_TEXT_WIDTH
private static final int DESCRIPTION_TEXT_WIDTH- See Also:
- Mappings:
Namespace Name Mixin selector intermediary field_39543Lnet/minecraft/class_7534;field_39543:Iofficial cLeto;c:Inamed DESCRIPTION_TEXT_WIDTHLnet/minecraft/client/gui/screen/TaskScreen;DESCRIPTION_TEXT_WIDTH:I
-
descriptionText
- Mappings:
Namespace Name Mixin selector intermediary field_39745Lnet/minecraft/class_7534;field_39745:Lnet/minecraft/class_2561;official jLeto;j:Lsw;named descriptionTextLnet/minecraft/client/gui/screen/TaskScreen;descriptionText:Lnet/minecraft/text/Text;
-
closeButtonText
- Mappings:
Namespace Name Mixin selector intermediary field_39544Lnet/minecraft/class_7534;field_39544:Lnet/minecraft/class_2561;official kLeto;k:Lsw;named closeButtonTextLnet/minecraft/client/gui/screen/TaskScreen;closeButtonText:Lnet/minecraft/text/Text;
-
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 intermediary field_39545Lnet/minecraft/class_7534;field_39545:Ljava/lang/Runnable;official lLeto;l:Ljava/lang/Runnable;named closeCallbackLnet/minecraft/client/gui/screen/TaskScreen;closeCallback:Ljava/lang/Runnable;
-
description
- Mappings:
Namespace Name Mixin selector intermediary field_39546Lnet/minecraft/class_7534;field_39546:Lnet/minecraft/class_5489;official mLeto;m:Lepq;named descriptionLnet/minecraft/client/gui/screen/TaskScreen;description:Lnet/minecraft/client/font/MultilineText;
-
button
The button to close the screen (potentially with a side effect, such as cancelling a task).- Mappings:
Namespace Name Mixin selector intermediary field_39547Lnet/minecraft/class_7534;field_39547:Lnet/minecraft/class_4185;official nLeto;n:Lepa;named buttonLnet/minecraft/client/gui/screen/TaskScreen;button:Lnet/minecraft/client/gui/widget/ButtonWidget;
-
buttonCooldown
private int buttonCooldownHow long the button should be disabled after the screen is displayed in ticks. Can be disabled by setting to0.- Mappings:
Namespace Name Mixin selector intermediary field_39746Lnet/minecraft/class_7534;field_39746:Iofficial oLeto;o:Inamed buttonCooldownLnet/minecraft/client/gui/screen/TaskScreen;buttonCooldown:I
-
-
Constructor Details
-
TaskScreen
protected TaskScreen(Text title, @Nullable @Nullable Text descriptionText, Text closeButtonText, Runnable closeCallback, int buttonCooldown) - Mappings:
Namespace Name Mixin selector intermediary <init>Lnet/minecraft/class_7534;<init>(Lnet/minecraft/class_2561;Lnet/minecraft/class_2561;Lnet/minecraft/class_2561;Ljava/lang/Runnable;I)Vofficial <init>Leto;<init>(Lsw;Lsw;Lsw;Ljava/lang/Runnable;I)Vnamed <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
-
-
Method Details
-
createRunningScreen
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 intermediary method_44690Lnet/minecraft/class_7534;method_44690(Lnet/minecraft/class_2561;Lnet/minecraft/class_2561;Ljava/lang/Runnable;)Lnet/minecraft/class_7534;official aLeto;a(Lsw;Lsw;Ljava/lang/Runnable;)Leto;named createRunningScreenLnet/minecraft/client/gui/screen/TaskScreen;createRunningScreen(Lnet/minecraft/text/Text;Lnet/minecraft/text/Text;Ljava/lang/Runnable;)Lnet/minecraft/client/gui/screen/TaskScreen;
-
createResultScreen
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 intermediary method_44691Lnet/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 aLeto;a(Lsw;Lsw;Lsw;Ljava/lang/Runnable;)Leto;named createResultScreenLnet/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;
-
init
protected void init()Called when a screen should be initialized.This method is called when this screen is opened or resized.
This should call
Screen.setInitialFocus(net.minecraft.client.gui.Element)to set the element that is initially focused. -
tick
public void tick() -
render
- Specified by:
renderin interfaceDrawable- Overrides:
renderin classScreen- Mappings:
Namespace Name Mixin selector intermediary method_25394Lnet/minecraft/class_4068;method_25394(Lnet/minecraft/class_332;IIF)Vofficial aLepy;a(Leop;IIF)Vnamed renderLnet/minecraft/client/gui/Drawable;render(Lnet/minecraft/client/gui/DrawContext;IIF)V
-
shouldCloseOnEsc
public boolean shouldCloseOnEsc()Checks whether this screen should be closed when the escape key is pressed.- Overrides:
shouldCloseOnEscin classScreen- Mappings:
Namespace Name Mixin selector intermediary method_25422Lnet/minecraft/class_437;method_25422()Zofficial av_Leug;av_()Znamed shouldCloseOnEscLnet/minecraft/client/gui/screen/Screen;shouldCloseOnEsc()Z
-
close
public void close() -
getNarratedTitle
- Overrides:
getNarratedTitlein classScreen- Mappings:
Namespace Name Mixin selector intermediary method_25435Lnet/minecraft/class_437;method_25435()Lnet/minecraft/class_2561;official au_Leug;au_()Lsw;named getNarratedTitleLnet/minecraft/client/gui/screen/Screen;getNarratedTitle()Lnet/minecraft/text/Text;
-