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,BookViewScreen,ChatScreen,ChatSelectionScreen,ConfirmExperimentalFeaturesScreen,ConfirmExperimentalFeaturesScreen.DetailsScreen,ConfirmScreen,ConnectScreen,CreateBuffetWorldScreen,CreateFlatWorldScreen,CreateWorldScreen,CreditsAndAttributionScreen,DatapackLoadFailureScreen,DeathScreen,DemoIntroScreen,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,RealmsScreen,ReceivingLevelScreen,RecoverWorldDataScreen,ReportPlayerScreen,ReportReasonSelectionScreen,SelectWorldScreen,ServerLinksScreen,ServerReconfigScreen,ShareToLanScreen,SocialInteractionsScreen,StatsScreen,StructureBlockEditScreen,TelemetryInfoScreen,TitleScreen,UnsupportedGraphicsWarningScreen,WarningScreen,WinScreen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final recordstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<GuiEventListener> protected static final CubeMapprivate Screen.DeferredTooltipRenderingprotected Fontstatic final ResourceLocationstatic final ResourceLocationintprivate booleanstatic final ResourceLocationstatic final ResourceLocationprivate static final ResourceLocationprivate NarratableEntryprivate static final org.slf4j.Loggerstatic final ResourceLocationprotected Minecraftprivate final List<NarratableEntry> private static final longprivate static final longprivate static final longprivate static final longprivate static final longprivate final ScreenNarrationCollectorprivate longprotected CycleButton<NarratorStatus> private longprotected static final PanoramaRendererfinal List<Renderable> protected final Executorprotected final Componentprivate static final ComponentintFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadded()private voidprotected <T extends Renderable>
TaddRenderableOnly(T pRenderable) protected <T extends GuiEventListener & Renderable & NarratableEntry>
TaddRenderableWidget(T pWidget) protected <T extends GuiEventListener & NarratableEntry>
TaddWidget(T pListener) voidvoidvoidprotected voidchangeFocus(ComponentPath pPath) List<? extends GuiEventListener> children()voidprotected voidprotected voidcreateArrowEvent(ScreenDirection pDirection) voidfillCrashDetails(CrashReport pCrashReport) findNarratableWidget(List<? extends NarratableEntry> pEntries, NarratableEntry pTarget) getFont()getTitle()getTooltipFromItem(Minecraft pMinecraft, ItemStack pItem) protected ComponentbooleanhandleComponentClicked(Style pStyle) voidstatic booleanstatic booleanstatic booleanprotected voidinit()final voidprotected voidinsertText(String pText, boolean pOverwrite) static booleanisCopy(int pKeyCode) static booleanisCut(int pKeyCode) booleanisMouseOver(double pMouseX, double pMouseY) Checks if the given mouse coordinates are over the GUI element.static booleanisPaste(int pKeyCode) booleanstatic booleanisSelectAll(int pKeyCode) protected booleanisValidCharacterForName(String pText, char pCharTyped, int pCursorPos) booleankeyPressed(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is pressed within the GUI element.voidonClose()voidonFilesDrop(List<Path> pPacks) protected voidvoidremoved()protected voidremoveWidget(GuiEventListener pListener) voidrender(GuiGraphics p_281549_, int p_281550_, int p_282878_, float p_282465_) Neo: mixins targeting this method won't fire for container screens asAbstractContainerScreen.render(net.minecraft.client.gui.GuiGraphics, int, int, float)replicates this method in place of a super call to insert an eventvoidrenderBackground(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) protected voidprotected voidrenderMenuBackground(GuiGraphics pPartialTick) protected voidrenderMenuBackground(GuiGraphics pGuiGraphics, int pX, int pY, int pWidth, int pHeight) static voidrenderMenuBackgroundTexture(GuiGraphics pGuiGraphics, ResourceLocation pTexture, int pX, int pY, float pUOffset, float pVOffset, int pWidth, int pHeight) protected voidrenderPanorama(GuiGraphics pGuiGraphics, float pPartialTick) voidrenderTransparentBackground(GuiGraphics pGuiGraphics) final voidrenderWithTooltip(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) protected voidvoidprivate voidrunNarration(boolean pOnlyNarrateNew) private voidscheduleNarration(long pDelay, boolean pStopSuppression) protected voidprotected voidsetInitialFocus(GuiEventListener pListener) voidsetTooltipForNextRenderPass(List<FormattedCharSequence> pTooltip) voidsetTooltipForNextRenderPass(List<FormattedCharSequence> pTooltip, ClientTooltipPositioner pPositioner, boolean pOverride) voidsetTooltipForNextRenderPass(Tooltip pTooltip, ClientTooltipPositioner pPositioner, boolean pOverride) voidsetTooltipForNextRenderPass(Component pTooltip) booleanprotected booleanprivate booleanbooleanprivate voidsuppressNarration(long pTime) voidtick()voidtriggerImmediateNarration(boolean pOnlyNarrateNew) protected voidupdateNarratedWidget(NarrationElementOutput pNarrationElementOutput) protected voidvoidupdateNarratorStatus(boolean pNarratorEnabled) Methods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
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.components.events.ContainerEventHandler
charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, setFocusedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getBorderForArrowNavigation, mouseMovedMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
USAGE_NARRATION
-
CUBE_MAP
-
PANORAMA
-
MENU_BACKGROUND
-
HEADER_SEPARATOR
-
FOOTER_SEPARATOR
-
INWORLD_MENU_BACKGROUND
-
INWORLD_HEADER_SEPARATOR
-
INWORLD_FOOTER_SEPARATOR
-
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
-
deferredTooltipRendering
-
screenExecutor
-
-
Constructor Details
-
Screen
-
-
Method Details
-
getTitle
-
getNarrationMessage
-
renderWithTooltip
public final void renderWithTooltip(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) -
render
Neo: mixins targeting this method won't fire for container screens asAbstractContainerScreen.render(net.minecraft.client.gui.GuiGraphics, int, int, float)replicates this method in place of a super call to insert an event- Specified by:
renderin interfaceRenderable- Parameters:
p_281549_- the GuiGraphics object used for rendering.p_281550_- the x-coordinate of the mouse cursor.p_282878_- the y-coordinate of the mouse cursor.p_282465_- the partial tick time.
-
keyPressed
public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers) Description copied from interface:ContainerEventHandlerCalled when a keyboard key is pressed within the GUI element.- Specified by:
keyPressedin interfaceContainerEventHandler- Specified by:
keyPressedin interfaceGuiEventListener- Parameters:
pKeyCode- the key code of the pressed key.pScanCode- the scan code of the pressed key.pModifiers- the keyboard modifiers.- Returns:
trueif the event is consumed,falseotherwise.
-
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
-
init
-
rebuildWidgets
protected void rebuildWidgets() -
children
- Specified by:
childrenin 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
protected void 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) Description copied from interface:GuiEventListenerChecks if the given mouse coordinates are over the GUI element.- Specified by:
isMouseOverin interfaceGuiEventListener- Parameters:
pMouseX- the X coordinate of the mouse.pMouseY- the Y coordinate of the mouse.- Returns:
trueif the mouse is over the GUI element,falseotherwise.
-
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) -
clearTooltipForNextRenderPass
protected void clearTooltipForNextRenderPass() -
setTooltipForNextRenderPass
-
setTooltipForNextRenderPass
public void setTooltipForNextRenderPass(List<FormattedCharSequence> pTooltip, ClientTooltipPositioner pPositioner, boolean pOverride) -
setTooltipForNextRenderPass
-
setTooltipForNextRenderPass
public void setTooltipForNextRenderPass(Tooltip pTooltip, ClientTooltipPositioner pPositioner, boolean pOverride) -
getFont
-
showsActiveEffects
public boolean showsActiveEffects() -
getRectangle
- Specified by:
getRectanglein interfaceGuiEventListener
-
getBackgroundMusic
-
addEventWidget
-