Package net.minecraft.client.gui.screens
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
,AbstractReportScreen
,AbstractSignEditScreen
,AccessibilityOnboardingScreen
,AdvancementsScreen
,AlertScreen
,BackupConfirmScreen
,BookEditScreen
,BookSignScreen
,BookViewScreen
,ChatScreen
,ChatSelectionScreen
,ConfirmExperimentalFeaturesScreen
,ConfirmExperimentalFeaturesScreen.DetailsScreen
,ConfirmScreen
,ConnectScreen
,CreateBuffetWorldScreen
,CreateFlatWorldScreen
,CreateWorldScreen
,CreditsAndAttributionScreen
,DatapackLoadFailureScreen
,DeathScreen
,DemoIntroScreen
,DialogScreen
,DirectJoinServerScreen
,DisconnectedScreen
,EditGameRulesScreen
,EditServerScreen
,EditWorldScreen
,ErrorScreen
,ExperimentsScreen
,GameModeSwitcherScreen
,GenericMessageScreen
,GenericWaitingScreen
,JigsawBlockEditScreen
,JoinMultiplayerScreen
,LevelLoadingScreen
,ModListScreen
,ModMismatchDisconnectedScreen
,NoticeWithLinkScreen
,OptimizeWorldScreen
,OptionsScreen
,OptionsSubScreen
,OutOfMemoryScreen
,PackSelectionScreen
,PauseScreen
,PauseScreen.FeedbackSubScreen
,PopupScreen
,PresetFlatWorldScreen
,ProgressScreen
,RealmsPreferredRegionSelectionScreen
,RealmsScreen
,ReceivingLevelScreen
,RecoverWorldDataScreen
,ReportPlayerScreen
,ReportReasonSelectionScreen
,SelectWorldScreen
,ServerReconfigScreen
,ShareToLanScreen
,SocialInteractionsScreen
,StatsScreen
,StructureBlockEditScreen
,TelemetryInfoScreen
,TestBlockEditScreen
,TestInstanceBlockEditScreen
,TitleScreen
,UnsupportedGraphicsWarningScreen
,WaitingForResponseScreen
,WarningScreen
,WinScreen
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<GuiEventListener> protected static final float
protected Font
static final ResourceLocation
static final ResourceLocation
int
private boolean
static final ResourceLocation
static final ResourceLocation
private static final ResourceLocation
private NarratableEntry
private static final org.slf4j.Logger
static final ResourceLocation
protected Minecraft
private final List
<NarratableEntry> private static final long
private static final long
private static final long
private static final long
private static final long
private final ScreenNarrationCollector
private long
protected CycleButton
<NarratorStatus> private long
final List
<Renderable> protected final Executor
protected final Component
private static final Component
int
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
added()
private void
protected <T extends Renderable>
TaddRenderableOnly
(T pRenderable) protected <T extends GuiEventListener & Renderable & NarratableEntry>
TaddRenderableWidget
(T pWidget) protected <T extends GuiEventListener & NarratableEntry>
TaddWidget
(T pListener) void
void
void
protected void
changeFocus
(ComponentPath pPath) List
<? extends GuiEventListener> children()
void
protected void
protected static void
clickCommandAction
(LocalPlayer pPlayer, String pCommand, Screen pScreen) protected static boolean
clickUrlAction
(Minecraft pMinecraft, Screen pScreen, URI pUrl) createArrowEvent
(ScreenDirection pDirection) protected static void
defaultHandleClickEvent
(ClickEvent pClickEvent, Minecraft pMinecraft, Screen pScreen) protected static void
defaultHandleGameClickEvent
(ClickEvent pClickEvent, Minecraft pMinecraft, Screen pScreen) protected void
fadeWidgets
(float pFade) void
fillCrashDetails
(CrashReport pCrashReport) findNarratableWidget
(List<? extends NarratableEntry> pEntries, NarratableEntry pTarget) getFont()
getTitle()
getTooltipFromItem
(Minecraft pMinecraft, ItemStack pItem) protected Component
protected void
handleClickEvent
(Minecraft pMinecraft, ClickEvent pClickEvent) boolean
handleComponentClicked
(Style pStyle) void
static boolean
static boolean
static boolean
protected void
init()
final void
protected void
insertText
(String pText, boolean pOverwrite) static boolean
isCopy
(int pKeyCode) static boolean
isCut
(int pKeyCode) boolean
isMouseOver
(double pMouseX, double pMouseY) Checks if the given mouse coordinates are over the GUI element.static boolean
isPaste
(int pKeyCode) boolean
static boolean
isSelectAll
(int pKeyCode) protected boolean
isValidCharacterForName
(String pText, char pCharTyped, int pCursorPos) boolean
keyPressed
(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is pressed within the GUI element.void
onClose()
void
onFilesDrop
(List<Path> pPacks) protected void
void
removed()
protected void
removeWidget
(GuiEventListener pListener) void
render
(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) Renders the graphical user interface (GUI) element.void
renderBackground
(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) protected void
renderBlurredBackground
(GuiGraphics pGuiGraphics) protected void
renderMenuBackground
(GuiGraphics pPartialTick) protected void
renderMenuBackground
(GuiGraphics pGuiGraphics, int pX, int pY, int pWidth, int pHeight) static void
renderMenuBackgroundTexture
(GuiGraphics pGuiGraphics, ResourceLocation pTexture, int pX, int pY, float pUOffset, float pVOffset, int pWidth, int pHeight) protected void
renderPanorama
(GuiGraphics pGuiGraphics, float pPartialTick) void
renderTransparentBackground
(GuiGraphics pGuiGraphics) final void
renderWithTooltip
(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) protected void
void
private void
runNarration
(boolean pOnlyNarrateNew) private void
scheduleNarration
(long pDelay, boolean pStopSuppression) protected void
protected void
setInitialFocus
(GuiEventListener pListener) boolean
protected boolean
private boolean
boolean
private void
suppressNarration
(long pTime) void
tick()
void
triggerImmediateNarration
(boolean pOnlyNarrateNew) protected void
updateNarratedWidget
(NarrationElementOutput pNarrationElementOutput) protected void
updateNarrationState
(NarrationElementOutput p_169396_) void
updateNarratorStatus
(boolean pNarratorEnabled) Methods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocused
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, setFocused
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getBorderForArrowNavigation, mouseMoved
Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
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
-
-
Method Details
-
getTitle
-
getNarrationMessage
-
renderWithTooltip
public final void renderWithTooltip(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) -
render
Renders the graphical user interface (GUI) element.- Specified by:
render
in interfaceRenderable
- Parameters:
pGuiGraphics
- the GuiGraphics object used for rendering.pMouseX
- the x-coordinate of the mouse cursor.pMouseY
- the y-coordinate of the mouse cursor.pPartialTick
- the partial tick time.
-
keyPressed
public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is pressed within the GUI element.- Specified by:
keyPressed
in interfaceContainerEventHandler
- Specified by:
keyPressed
in interfaceGuiEventListener
- Parameters:
pKeyCode
- the key code of the pressed key.pScanCode
- the scan code of the pressed key.pModifiers
- the keyboard modifiers.- Returns:
true
if the event is consumed,false
otherwise.
-
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 pWidget) -
addRenderableOnly
-
addWidget
-
removeWidget
-
clearWidgets
protected void clearWidgets() -
getTooltipFromItem
-
insertText
-
handleComponentClicked
-
handleClickEvent
-
defaultHandleGameClickEvent
protected static void defaultHandleGameClickEvent(ClickEvent pClickEvent, Minecraft pMinecraft, @Nullable Screen pScreen) -
defaultHandleClickEvent
protected static void defaultHandleClickEvent(ClickEvent pClickEvent, Minecraft pMinecraft, @Nullable Screen pScreen) -
clickUrlAction
-
clickCommandAction
protected static void clickCommandAction(LocalPlayer pPlayer, String pCommand, @Nullable Screen pScreen) -
init
-
rebuildWidgets
protected void rebuildWidgets() -
fadeWidgets
protected void fadeWidgets(float pFade) -
children
- Specified by:
children
in interfaceContainerEventHandler
-
init
protected void init() -
tick
public void tick() -
removed
public void removed() -
added
public void added() -
renderBackground
public void renderBackground(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) -
renderBlurredBackground
-
renderPanorama
-
renderMenuBackground
-
renderMenuBackground
protected void renderMenuBackground(GuiGraphics pGuiGraphics, int pX, int pY, int pWidth, int pHeight) -
renderMenuBackgroundTexture
public static void renderMenuBackgroundTexture(GuiGraphics pGuiGraphics, ResourceLocation pTexture, int pX, int pY, float pUOffset, float pVOffset, int pWidth, int pHeight) -
renderTransparentBackground
-
isPauseScreen
public boolean isPauseScreen() -
hasControlDown
public static boolean hasControlDown() -
hasShiftDown
public static boolean hasShiftDown() -
hasAltDown
public static boolean hasAltDown() -
isCut
public static boolean isCut(int pKeyCode) -
isPaste
public static boolean isPaste(int pKeyCode) -
isCopy
public static boolean isCopy(int pKeyCode) -
isSelectAll
public static boolean isSelectAll(int pKeyCode) -
repositionElements
protected void repositionElements() -
resize
-
fillCrashDetails
-
isValidCharacterForName
-
isMouseOver
public boolean isMouseOver(double pMouseX, double pMouseY) Checks if the given mouse coordinates are over the GUI element.- Specified by:
isMouseOver
in interfaceGuiEventListener
- Parameters:
pMouseX
- the X coordinate of the mouse.pMouseY
- the Y coordinate of the mouse.- Returns:
true
if the mouse is over the GUI element,false
otherwise.
-
onFilesDrop
-
getMinecraft
-
scheduleNarration
private void scheduleNarration(long pDelay, boolean pStopSuppression) -
suppressNarration
private void suppressNarration(long pTime) -
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 pOnlyNarrateNew) -
runNarration
private void runNarration(boolean pOnlyNarrateNew) -
updateNarrationState
-
updateNarratedWidget
-
getUsageNarration
-
findNarratableWidget
@Nullable public static Screen.NarratableSearchResult findNarratableWidget(List<? extends NarratableEntry> pEntries, @Nullable NarratableEntry pTarget) -
updateNarratorStatus
public void updateNarratorStatus(boolean pNarratorEnabled) -
getFont
-
showsActiveEffects
public boolean showsActiveEffects() -
getRectangle
- Specified by:
getRectangle
in interfaceGuiEventListener
-
getBackgroundMusic
-
addEventWidget
-