Class AbstractConfigScreen

java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
johnsmith.configoverhauled.impl.client.gui.screen.AbstractConfigScreen
All Implemented Interfaces:
ConfigScreen, net.minecraft.client.gui.components.events.ContainerEventHandler, net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.Renderable, net.minecraft.client.gui.components.TabOrderedElement
Direct Known Subclasses:
DefaultConfigScreen

public abstract class AbstractConfigScreen extends net.minecraft.client.gui.screens.Screen implements ConfigScreen
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen

    net.minecraft.client.gui.screens.Screen.NarratableSearchResult
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final net.minecraft.client.gui.screens.Screen
     

    Fields inherited from class net.minecraft.client.gui.screens.Screen

    FADE_IN_TIME, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, screenExecutor, title, width
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractConfigScreen(net.minecraft.network.chat.Component title, net.minecraft.client.gui.screens.Screen parentScreen)
     
    protected
    AbstractConfigScreen(net.minecraft.network.chat.Component title, net.minecraft.client.gui.screens.Screen parentScreen, WidgetRegistry widgetRegistry)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    charTyped(net.minecraft.client.input.CharacterEvent event)
     
    void
    Closes the currently active overlay modal popup, if any.
    createEntry(Property<T> property)
    Utility method for subclasses to easily create UI entries from properties.
    void
    extractRenderState(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphicsExtractor, int mouseX, int mouseY, float partialTick)
     
    boolean
    Checks whether an overlay modal popup is currently open on this screen.
    protected boolean
     
    boolean
    keyPressed(net.minecraft.client.input.KeyEvent event)
     
    boolean
    keyReleased(net.minecraft.client.input.KeyEvent event)
     
    void
    Flags the configuration state as modified, triggering network syncs or reload alerts on close.
    boolean
    mouseClicked(net.minecraft.client.input.MouseButtonEvent event, boolean doubleClick)
     
    boolean
    mouseDragged(net.minecraft.client.input.MouseButtonEvent event, double dragX, double dragY)
     
    boolean
    mouseReleased(net.minecraft.client.input.MouseButtonEvent event)
     
    boolean
    mouseScrolled(double mouseX, double mouseY, double scrollX, double scrollY)
     
    void
     
    protected void
    Callback triggered when a widget modifies a property's value.
    void
    Opens an overlay modal popup on top of this configuration screen without replacing the active screen.
    <P extends Property<?>>
    void
    registerWidget(Class<P> propertyClass, WidgetFactory<? super P> factory)
    Registers a custom widget factory for a specific property type.
    protected void
     
    void
    setDeferredTooltip(List<net.minecraft.util.FormattedCharSequence> tooltip)
    Passes a tooltip to the screen to be rendered at the highest Z-index during the render cycle.
    void
    Replaces the entire widget registry used by this screen.
    void
     

    Methods inherited from class net.minecraft.client.gui.screens.Screen

    added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, canInterruptWithAnotherScreen, changeFocus, children, clearFocus, clearWidgets, clickCommandAction, clickUrlAction, defaultHandleClickEvent, defaultHandleGameClickEvent, extractBackground, extractBlurredBackground, extractMenuBackground, extractMenuBackground, extractMenuBackgroundTexture, extractPanorama, extractRenderStateWithTooltipAndSubtitles, extractTransparentBackground, fadeWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleDelayedNarration, init, init, insertText, isAllowedInPortal, isInGameUi, isMouseOver, isPauseScreen, isValidCharacterForName, onFilesDrop, rebuildWidgets, removed, removeWidget, repositionElements, resize, setInitialFocus, setInitialFocus, shouldCloseOnEsc, shouldNarrateNavigation, showsActiveEffects, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatus

    Methods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler

    getFocused, isDragging, setDragging, setFocused

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface ConfigScreen

    updateMasterResetButton

    Methods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler

    getBorderForArrowNavigation, getChildAt, getCurrentFocusPath, isFocused, nextFocusPath, preeditUpdated, setFocused

    Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    mouseMoved, shouldTakeFocusAfterInteraction

    Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement

    getTabOrderGroup
  • Field Details

    • parentScreen

      protected final net.minecraft.client.gui.screens.Screen parentScreen
  • Constructor Details

    • AbstractConfigScreen

      protected AbstractConfigScreen(net.minecraft.network.chat.Component title, net.minecraft.client.gui.screens.Screen parentScreen)
    • AbstractConfigScreen

      protected AbstractConfigScreen(net.minecraft.network.chat.Component title, net.minecraft.client.gui.screens.Screen parentScreen, WidgetRegistry widgetRegistry)
  • Method Details

    • createEntry

      public <T> ConfigEntry createEntry(Property<T> property)
      Utility method for subclasses to easily create UI entries from properties.
      Specified by:
      createEntry in interface ConfigScreen
      Type Parameters:
      T - The underlying data type of the property.
      Parameters:
      property - The configuration property to create a widget for.
      Returns:
      A newly constructed ConfigEntry ready to be appended to the screen.
    • registerWidget

      public <P extends Property<?>> void registerWidget(Class<P> propertyClass, WidgetFactory<? super P> factory)
      Description copied from interface: ConfigScreen
      Registers a custom widget factory for a specific property type. Overrides the default widget if one already exists for the provided class.
      Specified by:
      registerWidget in interface ConfigScreen
      Type Parameters:
      P - The property type.
      Parameters:
      propertyClass - The class of the property.
      factory - The factory responsible for creating the widget.
    • setWidgetRegistry

      public void setWidgetRegistry(WidgetRegistry registry)
      Description copied from interface: ConfigScreen
      Replaces the entire widget registry used by this screen. Must be called before the screen initializes its internal lists.
      Specified by:
      setWidgetRegistry in interface ConfigScreen
      Parameters:
      registry - The custom registry implementation to use.
    • openPopup

      public void openPopup(ConfigPopup popup)
      Description copied from interface: ConfigScreen
      Opens an overlay modal popup on top of this configuration screen without replacing the active screen. If a popup is already open, it will be closed before opening the new one.
      Specified by:
      openPopup in interface ConfigScreen
      Parameters:
      popup - The popup to display.
    • closePopup

      public void closePopup()
      Description copied from interface: ConfigScreen
      Closes the currently active overlay modal popup, if any.
      Specified by:
      closePopup in interface ConfigScreen
    • hasActivePopup

      public boolean hasActivePopup()
      Description copied from interface: ConfigScreen
      Checks whether an overlay modal popup is currently open on this screen.
      Specified by:
      hasActivePopup in interface ConfigScreen
      Returns:
      true if a popup is currently active.
    • onValueChanged

      protected void onValueChanged()
      Callback triggered when a widget modifies a property's value.
    • markLevelConfigModified

      public void markLevelConfigModified()
      Description copied from interface: ConfigScreen
      Flags the configuration state as modified, triggering network syncs or reload alerts on close.
      Specified by:
      markLevelConfigModified in interface ConfigScreen
    • setDeferredTooltip

      public void setDeferredTooltip(List<net.minecraft.util.FormattedCharSequence> tooltip)
      Description copied from interface: ConfigScreen
      Passes a tooltip to the screen to be rendered at the highest Z-index during the render cycle.
      Specified by:
      setDeferredTooltip in interface ConfigScreen
      Parameters:
      tooltip - The formatted lines of text to display.
    • tick

      public void tick()
      Overrides:
      tick in class net.minecraft.client.gui.screens.Screen
    • repositionActivePopup

      protected void repositionActivePopup()
    • keyPressed

      public boolean keyPressed(net.minecraft.client.input.KeyEvent event)
      Specified by:
      keyPressed in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      keyPressed in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      keyPressed in class net.minecraft.client.gui.screens.Screen
    • keyReleased

      public boolean keyReleased(net.minecraft.client.input.KeyEvent event)
      Specified by:
      keyReleased in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      keyReleased in interface net.minecraft.client.gui.components.events.GuiEventListener
    • charTyped

      public boolean charTyped(net.minecraft.client.input.CharacterEvent event)
      Specified by:
      charTyped in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      charTyped in interface net.minecraft.client.gui.components.events.GuiEventListener
    • mouseClicked

      public boolean mouseClicked(net.minecraft.client.input.MouseButtonEvent event, boolean doubleClick)
      Specified by:
      mouseClicked in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      mouseClicked in interface net.minecraft.client.gui.components.events.GuiEventListener
    • mouseReleased

      public boolean mouseReleased(net.minecraft.client.input.MouseButtonEvent event)
      Specified by:
      mouseReleased in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      mouseReleased in interface net.minecraft.client.gui.components.events.GuiEventListener
    • mouseDragged

      public boolean mouseDragged(net.minecraft.client.input.MouseButtonEvent event, double dragX, double dragY)
      Specified by:
      mouseDragged in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      mouseDragged in interface net.minecraft.client.gui.components.events.GuiEventListener
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double scrollX, double scrollY)
      Specified by:
      mouseScrolled in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      mouseScrolled in interface net.minecraft.client.gui.components.events.GuiEventListener
    • extractRenderState

      public void extractRenderState(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphicsExtractor, int mouseX, int mouseY, float partialTick)
      Specified by:
      extractRenderState in interface net.minecraft.client.gui.components.Renderable
      Overrides:
      extractRenderState in class net.minecraft.client.gui.screens.Screen
    • onClose

      public void onClose()
      Overrides:
      onClose in class net.minecraft.client.gui.screens.Screen
    • hasReloadPermission

      protected boolean hasReloadPermission()