Class Screen
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
- All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement
- Direct Known Subclasses:
AbstractCommandBlockEditScreen, AbstractContainerScreen, AbstractGameRulesScreen, AbstractReportScreen, AbstractSignEditScreen, AccessibilityOnboardingScreen, AdvancementsScreen, AlertScreen, BackupConfirmScreen, BookEditScreen, BookSignScreen, BookViewScreen, ChatScreen, ChatSelectionScreen, ConfirmExperimentalFeaturesScreen, ConfirmExperimentalFeaturesScreen.DetailsScreen, ConfirmScreen, ConnectScreen, CreateBuffetWorldScreen, CreateFlatWorldScreen, CreateWorldScreen, CreditsAndAttributionScreen, DatapackLoadFailureScreen, DeathScreen, DebugOptionsScreen, DialogScreen, DirectJoinServerScreen, DisconnectedScreen, EditWorldScreen, ErrorScreen, ExperimentsScreen, FileFixerAbortedScreen, FileFixerProgressScreen, GameModeSwitcherScreen, GenericMessageScreen, GenericWaitingScreen, JigsawBlockEditScreen, JoinMultiplayerScreen, LevelLoadingScreen, ManageServerScreen, ModListScreen, ModMismatchDisconnectedScreen, NoticeWithLinkScreen, OptimizeWorldScreen, OptionsScreen, OptionsSubScreen, OutOfMemoryScreen, PackSelectionScreen, PauseScreen, PauseScreen.FeedbackSubScreen, PopupScreen, PresetFlatWorldScreen, ProgressScreen, RealmsPreferredRegionSelectionScreen, RealmsScreen, RecoverWorldDataScreen, ReportPlayerScreen, ReportReasonSelectionScreen, RestrictionsScreen, SelectWorldScreen, ServerReconfigScreen, ShareToLanScreen, SocialInteractionsScreen, StatsScreen, StructureBlockEditScreen, TelemetryInfoScreen, TestBlockEditScreen, TestInstanceBlockEditScreen, TitleScreen, UnsupportedGraphicsWarningScreen, WaitingForResponseScreen, WarningScreen, WinScreen, WorldOptionsScreen
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<GuiEventListener> protected static final floatprotected final Fontstatic final Identifierstatic final Identifierintprivate booleanstatic final Identifierstatic final Identifierprivate static final Identifierprivate @Nullable NarratableEntryprivate static final org.slf4j.Loggerstatic final Identifierprotected final Minecraftprivate final List<NarratableEntry> private static final longprivate static final longprivate static final longprivate static final longprivate static final longprivate final ScreenNarrationCollectorprivate longprotected @Nullable CycleButton<NarratorStatus> private longfinal List<Renderable> private static final Componentprotected final Executorprotected final Componentint -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadded()private voidprotected <T extends Renderable>
TaddRenderableOnly(T renderable) protected <T extends GuiEventListener & Renderable & NarratableEntry>
TaddRenderableWidget(T widget) protected <T extends GuiEventListener & NarratableEntry>
TaddWidget(T widget) voidvoidvoidbooleanprotected voidchangeFocus(ComponentPath componentPath) List<? extends GuiEventListener> children()voidprotected voidprotected static voidclickCommandAction(LocalPlayer player, String command, @Nullable Screen screenAfterCommand) protected static booleanclickUrlAction(Minecraft minecraft, @Nullable Screen screen, URI uri) createArrowEvent(ScreenDirection direction) createTabEvent(boolean forward) protected static voiddefaultHandleClickEvent(ClickEvent event, Minecraft minecraft, @Nullable Screen activeScreen) protected static voiddefaultHandleGameClickEvent(ClickEvent event, Minecraft minecraft, @Nullable Screen activeScreen) protected voidfadeWidgets(float widgetFade) voidfillCrashDetails(CrashReport report) static @Nullable Screen.NarratableSearchResultfindNarratableWidget(List<? extends NarratableEntry> narratableEntries, @Nullable NarratableEntry lastNarratable) @Nullable MusicgetFont()getTitle()getTooltipFromItem(Minecraft minecraft, ItemStack itemStack) protected Componentvoidprotected voidinit()final voidinit(int width, int height) protected voidinsertText(String text, boolean replace) booleanbooleanbooleanisMouseOver(double mouseX, double mouseY) Checks if the given mouse coordinates are over the GUI element.booleanprotected booleanisValidCharacterForName(String currentName, int newChar, int cursorPos) booleankeyPressed(KeyEvent event) voidonClose()voidonFilesDrop(List<Path> files) protected booleanprotected voidvoidremoved()protected voidremoveWidget(GuiEventListener widget) voidrender(GuiGraphics graphics, int mouseX, int mouseY, float a) Renders the graphical user interface (GUI) element.voidrenderBackground(GuiGraphics graphics, int mouseX, int mouseY, float a) protected voidrenderBlurredBackground(GuiGraphics graphics) protected voidrenderMenuBackground(GuiGraphics graphics) protected voidrenderMenuBackground(GuiGraphics graphics, int x, int y, int width, int height) static voidrenderMenuBackgroundTexture(GuiGraphics graphics, Identifier menuBackground, int x, int y, float u, float v, int width, int height) protected voidrenderPanorama(GuiGraphics graphics, float a) voidrenderTransparentBackground(GuiGraphics graphics) final voidrenderWithTooltipAndSubtitles(GuiGraphics graphics, int mouseX, int mouseY, float a) protected voidvoidresize(int width, int height) private voidrunNarration(boolean onlyChanged) private voidscheduleNarration(long delay, boolean ignoreSuppression) protected voidprotected voidsetInitialFocus(GuiEventListener target) private voidsetNarrationSuppressTime(long narrationSuppressTime) booleanprotected booleanprivate booleanbooleanprivate voidsuppressNarration(long duration) voidtick()voidtriggerImmediateNarration(boolean onlyChanged) protected voidprotected voidvoidupdateNarratorStatus(boolean wasDisabled) Methods inherited from class AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContainerEventHandler
charTyped, getBorderForArrowNavigation, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, setFocusedMethods inherited from interface GuiEventListener
mouseMoved, shouldTakeFocusAfterInteractionMethods inherited from interface TabOrderedElement
getTabOrderGroup
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
SCREEN_USAGE_NARRATION
-
MENU_BACKGROUND
-
HEADER_SEPARATOR
-
FOOTER_SEPARATOR
-
INWORLD_MENU_BACKGROUND
-
INWORLD_HEADER_SEPARATOR
-
INWORLD_FOOTER_SEPARATOR
-
FADE_IN_TIME
protected static final float FADE_IN_TIME- See Also:
-
title
-
children
-
narratables
-
minecraft
-
initialized
private boolean initialized -
width
public int width -
height
public int height -
renderables
-
font
-
NARRATE_SUPPRESS_AFTER_INIT_TIME
private static final long NARRATE_SUPPRESS_AFTER_INIT_TIME -
NARRATE_DELAY_NARRATOR_ENABLED
private static final long NARRATE_DELAY_NARRATOR_ENABLED -
NARRATE_DELAY_MOUSE_MOVE
private static final long NARRATE_DELAY_MOUSE_MOVE- See Also:
-
NARRATE_DELAY_MOUSE_ACTION
private static final long NARRATE_DELAY_MOUSE_ACTION- See Also:
-
NARRATE_DELAY_KEYBOARD_ACTION
private static final long NARRATE_DELAY_KEYBOARD_ACTION- See Also:
-
narrationState
-
narrationSuppressTime
private long narrationSuppressTime -
nextNarrationTime
private long nextNarrationTime -
narratorButton
-
lastNarratable
-
screenExecutor
-
-
Constructor Details
-
Screen
-
Screen
-
-
Method Details
-
getTitle
-
getNarrationMessage
-
renderWithTooltipAndSubtitles
public final void renderWithTooltipAndSubtitles(GuiGraphics graphics, int mouseX, int mouseY, float a) -
render
Description copied from interface:RenderableRenders the graphical user interface (GUI) element.- Specified by:
renderin interfaceRenderable- Parameters:
graphics- the GuiGraphics object used for rendering.mouseX- the x-coordinate of the mouse cursor.mouseY- the y-coordinate of the mouse cursor.a- the partial tick time.
-
keyPressed
- Specified by:
keyPressedin interfaceContainerEventHandler- Specified by:
keyPressedin interfaceGuiEventListener
-
createTabEvent
-
setInitialFocus
protected void setInitialFocus() -
setInitialFocus
-
clearFocus
public void clearFocus() -
changeFocus
-
shouldCloseOnEsc
public boolean shouldCloseOnEsc() -
onClose
public void onClose() -
addRenderableWidget
protected <T extends GuiEventListener & Renderable & NarratableEntry> T addRenderableWidget(T widget) -
addRenderableOnly
-
addWidget
-
removeWidget
-
clearWidgets
protected void clearWidgets() -
getTooltipFromItem
-
insertText
-
defaultHandleGameClickEvent
protected static void defaultHandleGameClickEvent(ClickEvent event, Minecraft minecraft, @Nullable Screen activeScreen) -
defaultHandleClickEvent
protected static void defaultHandleClickEvent(ClickEvent event, Minecraft minecraft, @Nullable Screen activeScreen) -
clickUrlAction
-
clickCommandAction
protected static void clickCommandAction(LocalPlayer player, String command, @Nullable Screen screenAfterCommand) -
init
public final void init(int width, int height) -
rebuildWidgets
protected void rebuildWidgets() -
fadeWidgets
protected void fadeWidgets(float widgetFade) -
children
- Specified by:
childrenin interfaceContainerEventHandler
-
init
protected void init() -
tick
public void tick() -
removed
public void removed() -
added
public void added() -
renderBackground
-
renderBlurredBackground
-
renderPanorama
-
renderMenuBackground
-
renderMenuBackground
-
renderMenuBackgroundTexture
public static void renderMenuBackgroundTexture(GuiGraphics graphics, Identifier menuBackground, int x, int y, float u, float v, int width, int height) -
renderTransparentBackground
-
isPauseScreen
public boolean isPauseScreen() -
isInGameUi
public boolean isInGameUi() -
panoramaShouldSpin
protected boolean panoramaShouldSpin() -
isAllowedInPortal
public boolean isAllowedInPortal() -
repositionElements
protected void repositionElements() -
resize
public void resize(int width, int height) -
fillCrashDetails
-
isValidCharacterForName
-
isMouseOver
public boolean isMouseOver(double mouseX, double mouseY) Description copied from interface:GuiEventListenerChecks if the given mouse coordinates are over the GUI element.- Specified by:
isMouseOverin interfaceGuiEventListener- Parameters:
mouseX- the X coordinate of the mouse.mouseY- the Y coordinate of the mouse.- Returns:
trueif the mouse is over the GUI element,falseotherwise.
-
onFilesDrop
-
getMinecraft
-
scheduleNarration
private void scheduleNarration(long delay, boolean ignoreSuppression) -
suppressNarration
private void suppressNarration(long duration) -
setNarrationSuppressTime
private void setNarrationSuppressTime(long narrationSuppressTime) -
afterMouseMove
public void afterMouseMove() -
afterMouseAction
public void afterMouseAction() -
afterKeyboardAction
public void afterKeyboardAction() -
shouldRunNarration
private boolean shouldRunNarration() -
handleDelayedNarration
public void handleDelayedNarration() -
triggerImmediateNarration
public void triggerImmediateNarration(boolean onlyChanged) -
runNarration
private void runNarration(boolean onlyChanged) -
updateNarrationState
-
updateNarratedWidget
-
getUsageNarration
-
findNarratableWidget
public static @Nullable Screen.NarratableSearchResult findNarratableWidget(List<? extends NarratableEntry> narratableEntries, @Nullable NarratableEntry lastNarratable) -
updateNarratorStatus
public void updateNarratorStatus(boolean wasDisabled) -
getFont
-
showsActiveEffects
public boolean showsActiveEffects() -
canInterruptWithAnotherScreen
public boolean canInterruptWithAnotherScreen() -
getRectangle
- Specified by:
getRectanglein interfaceGuiEventListener
-
getBackgroundMusic
-
addEventWidget
-