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 record
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<GuiEventListener> protected static final CubeMap
private Screen.DeferredTooltipRendering
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
protected static final PanoramaRenderer
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 renderable) protected <T extends GuiEventListener & Renderable & NarratableEntry>
TaddRenderableWidget
(T widget) protected <T extends GuiEventListener & NarratableEntry>
TaddWidget
(T listener) void
void
void
protected void
changeFocus
(ComponentPath path) List
<? extends GuiEventListener> children()
void
protected void
protected void
createArrowEvent
(ScreenDirection direction) findNarratableWidget
(List<? extends NarratableEntry> entries, NarratableEntry target) getTitle()
getTooltipFromItem
(Minecraft minecraft, ItemStack item) protected Component
boolean
handleComponentClicked
(Style style) void
static boolean
static boolean
static boolean
protected void
init()
final void
protected void
insertText
(String text, boolean overwrite) static boolean
isCopy
(int keyCode) static boolean
isCut
(int keyCode) boolean
isMouseOver
(double mouseX, double mouseY) Checks if the given mouse coordinates are over the GUI element.static boolean
isPaste
(int keyCode) boolean
static boolean
isSelectAll
(int keyCode) protected boolean
isValidCharacterForName
(String text, char charTyped, int cursorPos) boolean
keyPressed
(int keyCode, int scanCode, int modifiers) Called when a keyboard key is pressed within the GUI element.void
onClose()
void
onFilesDrop
(List<Path> packs) protected void
void
removed()
protected void
removeWidget
(GuiEventListener listener) void
render
(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) 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 eventvoid
renderBackground
(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) protected void
renderBlurredBackground
(float partialTick) protected void
renderMenuBackground
(GuiGraphics partialTick) protected void
renderMenuBackground
(GuiGraphics guiGraphics, int x, int y, int width, int height) static void
renderMenuBackgroundTexture
(GuiGraphics guiGraphics, ResourceLocation texture, int x, int y, float uOffset, float vOffset, int width, int height) protected void
renderPanorama
(GuiGraphics guiGraphics, float partialTick) void
renderTransparentBackground
(GuiGraphics guiGraphics) final void
renderWithTooltip
(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) protected void
void
private void
runNarration
(boolean onlyNarrateNew) private void
scheduleNarration
(long delay, boolean stopSuppression) protected void
protected void
setInitialFocus
(GuiEventListener listener) void
void
setTooltipForNextRenderPass
(List<FormattedCharSequence> tooltip, ClientTooltipPositioner positioner, boolean override) void
setTooltipForNextRenderPass
(Tooltip tooltip, ClientTooltipPositioner positioner, boolean override) void
setTooltipForNextRenderPass
(Component tooltip) boolean
protected boolean
private boolean
private void
suppressNarration
(long time) void
tick()
void
triggerImmediateNarration
(boolean onlyNarrateNew) protected void
updateNarratedWidget
(NarrationElementOutput narrationElementOutput) protected void
void
updateNarratorStatus
(boolean narratorEnabled) static void
wrapScreenError
(Runnable action, String errorDesc, String screenName) 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
mouseMoved
Methods 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 guiGraphics, int mouseX, int mouseY, float partialTick) -
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 eventRenders the graphical user interface (GUI) element.
- Specified by:
render
in interfaceRenderable
- Parameters:
guiGraphics
- the GuiGraphics object used for rendering.mouseX
- the x-coordinate of the mouse cursor.mouseY
- the y-coordinate of the mouse cursor.partialTick
- the partial tick time.
-
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers) Called when a keyboard key is pressed within the GUI element.- Specified by:
keyPressed
in interfaceContainerEventHandler
- Specified by:
keyPressed
in interfaceGuiEventListener
- Parameters:
keyCode
- the key code of the pressed key.scanCode
- the scan code of the pressed key.modifiers
- 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 widget) -
addRenderableOnly
-
addWidget
-
removeWidget
-
clearWidgets
protected void clearWidgets() -
getTooltipFromItem
-
insertText
-
handleComponentClicked
-
init
-
rebuildWidgets
protected void rebuildWidgets() -
children
- Specified by:
children
in interfaceContainerEventHandler
-
init
protected void init() -
tick
public void tick() -
removed
public void removed() -
added
public void added() -
renderBackground
-
renderBlurredBackground
protected void renderBlurredBackground(float partialTick) -
renderPanorama
-
renderMenuBackground
-
renderMenuBackground
-
renderMenuBackgroundTexture
public static void renderMenuBackgroundTexture(GuiGraphics guiGraphics, ResourceLocation texture, int x, int y, float uOffset, float vOffset, int width, int height) -
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 keyCode) -
isPaste
public static boolean isPaste(int keyCode) -
isCopy
public static boolean isCopy(int keyCode) -
isSelectAll
public static boolean isSelectAll(int keyCode) -
repositionElements
protected void repositionElements() -
resize
-
wrapScreenError
-
isValidCharacterForName
-
isMouseOver
public boolean isMouseOver(double mouseX, double mouseY) Checks if the given mouse coordinates are over the GUI element.- Specified by:
isMouseOver
in interfaceGuiEventListener
- Parameters:
mouseX
- the X coordinate of the mouse.mouseY
- 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 delay, boolean stopSuppression) -
suppressNarration
private void suppressNarration(long time) -
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 onlyNarrateNew) -
runNarration
private void runNarration(boolean onlyNarrateNew) -
updateNarrationState
-
updateNarratedWidget
-
getUsageNarration
-
findNarratableWidget
@Nullable public static Screen.NarratableSearchResult findNarratableWidget(List<? extends NarratableEntry> entries, @Nullable NarratableEntry target) -
updateNarratorStatus
public void updateNarratorStatus(boolean narratorEnabled) -
clearTooltipForNextRenderPass
protected void clearTooltipForNextRenderPass() -
setTooltipForNextRenderPass
-
setTooltipForNextRenderPass
public void setTooltipForNextRenderPass(List<FormattedCharSequence> tooltip, ClientTooltipPositioner positioner, boolean override) -
setTooltipForNextRenderPass
-
setTooltipForNextRenderPass
public void setTooltipForNextRenderPass(Tooltip tooltip, ClientTooltipPositioner positioner, boolean override) -
getRectangle
- Specified by:
getRectangle
in interfaceGuiEventListener
-
getBackgroundMusic
-
addEventWidget
-