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
FieldsModifier and TypeFieldDescriptionprotected final net.minecraft.client.gui.screens.ScreenFields 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, renderables, screenExecutor, title, width -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractConfigScreen(net.minecraft.network.chat.Component title, net.minecraft.client.gui.screens.Screen parentScreen) protectedAbstractConfigScreen(net.minecraft.network.chat.Component title, net.minecraft.client.gui.screens.Screen parentScreen, WidgetRegistry widgetRegistry) -
Method Summary
Modifier and TypeMethodDescription<T> ConfigEntrycreateEntry(Property<T> property) Utility method for subclasses to easily create UI entries from properties.voidextractRenderState(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphicsExtractor, int mouseX, int mouseY, float partialTick) protected booleanvoidFlags the configuration state as modified, triggering network syncs or reload alerts on close.voidonClose()protected voidCallback triggered when a widget modifies a property's value.<P extends Property<?>>
voidregisterWidget(Class<P> propertyClass, WidgetFactory<? super P> factory) Registers a custom widget factory for a specific property type.voidsetDeferredTooltip(List<net.minecraft.util.FormattedCharSequence> tooltip) Passes a tooltip to the screen to be rendered at the highest Z-index during the render cycle.voidsetWidgetRegistry(WidgetRegistry registry) Replaces the entire widget registry used by this screen.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, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleDelayedNarration, init, init, insertText, isAllowedInPortal, isInGameUi, isMouseOver, isPauseScreen, isValidCharacterForName, keyPressed, onFilesDrop, panoramaShouldSpin, rebuildWidgets, removed, removeWidget, repositionElements, resize, setInitialFocus, setInitialFocus, shouldCloseOnEsc, shouldNarrateNavigation, showsActiveEffects, tick, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatusMethods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ConfigScreen
updateMasterResetButtonMethods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
charTyped, getBorderForArrowNavigation, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, preeditUpdated, setFocusedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMoved, shouldTakeFocusAfterInteractionMethods 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
Utility method for subclasses to easily create UI entries from properties.- Specified by:
createEntryin interfaceConfigScreen- Type Parameters:
T- The underlying data type of the property.- Parameters:
property- The configuration property to create a widget for.- Returns:
- A newly constructed
ConfigEntryready to be appended to the screen.
-
registerWidget
public <P extends Property<?>> void registerWidget(Class<P> propertyClass, WidgetFactory<? super P> factory) Description copied from interface:ConfigScreenRegisters a custom widget factory for a specific property type. Overrides the default widget if one already exists for the provided class.- Specified by:
registerWidgetin interfaceConfigScreen- Type Parameters:
P- The property type.- Parameters:
propertyClass- The class of the property.factory- The factory responsible for creating the widget.
-
setWidgetRegistry
Description copied from interface:ConfigScreenReplaces the entire widget registry used by this screen. Must be called before the screen initializes its internal lists.- Specified by:
setWidgetRegistryin interfaceConfigScreen- Parameters:
registry- The custom registry implementation to use.
-
onValueChanged
protected void onValueChanged()Callback triggered when a widget modifies a property's value. -
markLevelConfigModified
public void markLevelConfigModified()Description copied from interface:ConfigScreenFlags the configuration state as modified, triggering network syncs or reload alerts on close.- Specified by:
markLevelConfigModifiedin interfaceConfigScreen
-
setDeferredTooltip
Description copied from interface:ConfigScreenPasses a tooltip to the screen to be rendered at the highest Z-index during the render cycle.- Specified by:
setDeferredTooltipin interfaceConfigScreen- Parameters:
tooltip- The formatted lines of text to display.
-
extractRenderState
public void extractRenderState(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphicsExtractor, int mouseX, int mouseY, float partialTick) - Specified by:
extractRenderStatein interfacenet.minecraft.client.gui.components.Renderable- Overrides:
extractRenderStatein classnet.minecraft.client.gui.screens.Screen
-
onClose
public void onClose()- Overrides:
onClosein classnet.minecraft.client.gui.screens.Screen
-
hasReloadPermission
protected boolean hasReloadPermission()
-