Class 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, TitleScreenModUpdateIndicator, UnsupportedGraphicsWarningScreen, WarningScreen, WinScreen

public abstract class Screen extends AbstractContainerEventHandler implements Renderable
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • USAGE_NARRATION

      private static final Component USAGE_NARRATION
    • CUBE_MAP

      protected static final CubeMap CUBE_MAP
    • PANORAMA

      protected static final PanoramaRenderer PANORAMA
    • HEADER_SEPARATOR

      public static final ResourceLocation HEADER_SEPARATOR
    • INWORLD_MENU_BACKGROUND

      private static final ResourceLocation INWORLD_MENU_BACKGROUND
    • INWORLD_HEADER_SEPARATOR

      public static final ResourceLocation INWORLD_HEADER_SEPARATOR
    • title

      protected final Component title
    • children

      private final List<GuiEventListener> children
    • narratables

      private final List<NarratableEntry> narratables
    • minecraft

      @Nullable protected Minecraft minecraft
    • initialized

      private boolean initialized
    • width

      public int width
    • height

      public int height
    • renderables

      public final List<Renderable> renderables
    • font

      protected Font 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

      private final ScreenNarrationCollector narrationState
    • narrationSuppressTime

      private long narrationSuppressTime
    • nextNarrationTime

      private long nextNarrationTime
    • narratorButton

      @Nullable protected CycleButton<NarratorStatus> narratorButton
    • lastNarratable

      @Nullable private NarratableEntry lastNarratable
    • deferredTooltipRendering

      @Nullable private Screen.DeferredTooltipRendering deferredTooltipRendering
    • screenExecutor

      protected final Executor screenExecutor
  • Constructor Details

    • Screen

      protected Screen(Component p_96550_)
  • Method Details

    • getTitle

      public Component getTitle()
    • getNarrationMessage

      public Component getNarrationMessage()
    • renderWithTooltip

      public final void renderWithTooltip(GuiGraphics p_282345_, int p_283456_, int p_283586_, float p_282339_)
    • render

      public void render(GuiGraphics p_281549_, int p_281550_, int p_282878_, float p_282465_)
      Specified by:
      render in interface Renderable
    • keyPressed

      public boolean keyPressed(int p_96552_, int p_96553_, int p_96554_)
      Specified by:
      keyPressed in interface ContainerEventHandler
      Specified by:
      keyPressed in interface GuiEventListener
    • createTabEvent

      private FocusNavigationEvent.TabNavigation createTabEvent()
    • createArrowEvent

      private FocusNavigationEvent.ArrowNavigation createArrowEvent(ScreenDirection p_265049_)
    • setInitialFocus

      protected void setInitialFocus()
    • setInitialFocus

      protected void setInitialFocus(GuiEventListener p_265756_)
    • clearFocus

      public void clearFocus()
    • changeFocus

      protected void changeFocus(ComponentPath p_265308_)
    • shouldCloseOnEsc

      public boolean shouldCloseOnEsc()
    • onClose

      public void onClose()
    • addRenderableWidget

      protected <T extends GuiEventListener & Renderable & NarratableEntry> T addRenderableWidget(T p_169406_)
    • addRenderableOnly

      protected <T extends Renderable> T addRenderableOnly(T p_254514_)
    • addWidget

      protected <T extends GuiEventListener & NarratableEntry> T addWidget(T p_96625_)
    • removeWidget

      protected void removeWidget(GuiEventListener p_169412_)
    • clearWidgets

      protected void clearWidgets()
    • getTooltipFromItem

      public static List<Component> getTooltipFromItem(Minecraft p_281881_, ItemStack p_282833_)
    • insertText

      protected void insertText(String p_96587_, boolean p_96588_)
    • handleComponentClicked

      public boolean handleComponentClicked(@Nullable Style p_96592_)
    • init

      public final void init(Minecraft p_96607_, int p_96608_, int p_96609_)
    • rebuildWidgets

      protected void rebuildWidgets()
    • children

      public List<? extends GuiEventListener> children()
      Specified by:
      children in interface ContainerEventHandler
    • init

      protected void init()
    • tick

      public void tick()
    • removed

      public void removed()
    • added

      public void added()
    • renderBackground

      public void renderBackground(GuiGraphics p_283688_, int p_299421_, int p_298679_, float p_297268_)
    • renderBlurredBackground

      protected void renderBlurredBackground(float p_336041_)
    • renderPanorama

      protected void renderPanorama(GuiGraphics p_332550_, float p_335227_)
    • renderMenuBackground

      protected void renderMenuBackground(GuiGraphics p_332667_)
    • renderMenuBackground

      protected void renderMenuBackground(GuiGraphics p_334761_, int p_328355_, int p_328091_, int p_332954_, int p_331811_)
    • renderMenuBackgroundTexture

      public static void renderMenuBackgroundTexture(GuiGraphics p_331670_, ResourceLocation p_330833_, int p_332491_, int p_335034_, float p_330279_, float p_334888_, int p_331386_, int p_330145_)
    • renderTransparentBackground

      public void renderTransparentBackground(GuiGraphics p_300203_)
    • 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 p_96629_)
    • isPaste

      public static boolean isPaste(int p_96631_)
    • isCopy

      public static boolean isCopy(int p_96633_)
    • isSelectAll

      public static boolean isSelectAll(int p_96635_)
    • repositionElements

      protected void repositionElements()
    • resize

      public void resize(Minecraft p_96575_, int p_96576_, int p_96577_)
    • wrapScreenError

      public static void wrapScreenError(Runnable p_96580_, String p_96581_, String p_96582_)
    • isValidCharacterForName

      protected boolean isValidCharacterForName(String p_96584_, char p_96585_, int p_96586_)
    • isMouseOver

      public boolean isMouseOver(double p_96595_, double p_96596_)
      Specified by:
      isMouseOver in interface GuiEventListener
    • onFilesDrop

      public void onFilesDrop(List<Path> p_96591_)
    • getMinecraft

      @Nullable public Minecraft getMinecraft()
    • addEventWidget

      private void addEventWidget(GuiEventListener guiEventListener)
    • scheduleNarration

      private void scheduleNarration(long p_169381_, boolean p_169382_)
    • suppressNarration

      private void suppressNarration(long p_169379_)
    • 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 p_169408_)
    • runNarration

      private void runNarration(boolean p_169410_)
    • shouldNarrateNavigation

      protected boolean shouldNarrateNavigation()
    • updateNarrationState

      protected void updateNarrationState(NarrationElementOutput p_169396_)
    • updateNarratedWidget

      protected void updateNarratedWidget(NarrationElementOutput p_169403_)
    • getUsageNarration

      protected Component getUsageNarration()
    • findNarratableWidget

      @Nullable public static Screen.NarratableSearchResult findNarratableWidget(List<? extends NarratableEntry> p_169401_, @Nullable NarratableEntry p_169402_)
    • updateNarratorStatus

      public void updateNarratorStatus(boolean p_345154_)
    • clearTooltipForNextRenderPass

      protected void clearTooltipForNextRenderPass()
    • setTooltipForNextRenderPass

      public void setTooltipForNextRenderPass(List<FormattedCharSequence> p_259937_)
    • setTooltipForNextRenderPass

      public void setTooltipForNextRenderPass(List<FormattedCharSequence> p_262939_, ClientTooltipPositioner p_263078_, boolean p_263107_)
    • setTooltipForNextRenderPass

      public void setTooltipForNextRenderPass(Component p_259986_)
    • setTooltipForNextRenderPass

      public void setTooltipForNextRenderPass(Tooltip p_262992_, ClientTooltipPositioner p_262980_, boolean p_262988_)
    • getRectangle

      public ScreenRectangle getRectangle()
      Specified by:
      getRectangle in interface GuiEventListener
    • getBackgroundMusic

      @Nullable public Music getBackgroundMusic()