Class OptionEntry<T, W extends net.minecraft.client.gui.components.AbstractWidget>
java.lang.Object
net.minecraft.client.gui.components.ContainerObjectSelectionList.Entry<AbstractConfigEntry>
johnsmith.configoverhauled.api.client.gui.entry.AbstractConfigEntry
johnsmith.configoverhauled.impl.client.gui.entry.OptionEntry<T,W>
- All Implemented Interfaces:
ConfigEntry, net.minecraft.client.gui.components.events.ContainerEventHandler, net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.TabOrderedElement, net.minecraft.client.gui.layouts.LayoutElement
- Direct Known Subclasses:
AbstractRegistryEntry, AbstractTextEntry, BooleanEntry, EnumEntry
public abstract class OptionEntry<T, W extends net.minecraft.client.gui.components.AbstractWidget>
extends AbstractConfigEntry
implements ConfigEntry
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @Nullable net.minecraft.client.gui.components.Buttonprotected final booleanprotected final net.minecraft.network.chat.Componentprotected final net.minecraft.client.Minecraftprotected final Runnableprotected final ConfigScreenprotected final net.minecraft.client.gui.components.Buttonprotected final List<net.minecraft.util.FormattedCharSequence> protected final W -
Constructor Summary
ConstructorsConstructorDescriptionOptionEntry(Property<T> property, ConfigScreen parentScreen, net.minecraft.client.Minecraft minecraft, Runnable onValueChanged) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanReset()@NotNull List<? extends net.minecraft.client.gui.components.events.GuiEventListener> children()protected net.minecraft.client.gui.components.Buttonprotected abstract Wstatic booleandetermineLockState(net.minecraft.client.Minecraft minecraft, Property<?> property) voidextractContent(@NotNull net.minecraft.client.gui.GuiGraphicsExtractor guiGraphicsExtractor, int mouseX, int mouseY, boolean isHovering, float partialTick) protected net.minecraft.network.chat.Componentprotected net.minecraft.network.chat.Componentprotected net.minecraft.network.chat.Componentprotected intgetMaxLabelWidth(int widgetX) protected booleanWhether this entry exposes a 20x20 square detail-editor button to the left of its primary widget.booleanbooleanEvaluates if the current UI state differs from the property's defaultValue().booleanmatchesSearch(String query) Evaluates if the widget matches the current search bar query.@NotNull List<? extends net.minecraft.client.gui.narration.NarratableEntry> protected voidOpens the detailed modal editor popup for this entry viaConfigScreen.openPopup(ConfigPopup).voidRestores the bound property to its defaultValue() and updates the UI state.protected voidprotected voidprotected abstract voidMethods inherited from class net.minecraft.client.gui.components.ContainerObjectSelectionList.Entry
focusPathAtIndex, getFocused, isDragging, mouseClicked, nextFocusPath, setDragging, setFocusedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
charTyped, getBorderForArrowNavigation, getChildAt, getCurrentFocusPath, isFocused, keyPressed, keyReleased, mouseDragged, mouseReleased, mouseScrolled, preeditUpdated, setFocusedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
capturesInput, getRectangle, isMouseOver, mouseMoved, shouldTakeFocusAfterInteractionMethods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPositionMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
parentScreen
-
property
-
resetButton
protected final net.minecraft.client.gui.components.Button resetButton -
detailButton
@Nullable protected final @Nullable net.minecraft.client.gui.components.Button detailButton -
widget
-
labelComponent
protected final net.minecraft.network.chat.Component labelComponent -
tooltip
-
minecraft
protected final net.minecraft.client.Minecraft minecraft -
onValueChanged
-
isLocked
protected final boolean isLocked
-
-
Constructor Details
-
OptionEntry
public OptionEntry(Property<T> property, ConfigScreen parentScreen, net.minecraft.client.Minecraft minecraft, Runnable onValueChanged)
-
-
Method Details
-
hasDetailPopup
protected boolean hasDetailPopup()Whether this entry exposes a 20x20 square detail-editor button to the left of its primary widget.Invoked during
OptionEntryconstruction; subclasses overriding this method should return a constant value without depending on subclass fields initialized aftersuper(...). -
openDetailPopup
protected void openDetailPopup()Opens the detailed modal editor popup for this entry viaConfigScreen.openPopup(ConfigPopup). -
createDetailButton
protected net.minecraft.client.gui.components.Button createDetailButton() -
getDetailButtonLabel
protected net.minecraft.network.chat.Component getDetailButtonLabel() -
getDetailButtonTooltip
protected net.minecraft.network.chat.Component getDetailButtonTooltip() -
matchesSearch
Description copied from interface:ConfigEntryEvaluates if the widget matches the current search bar query.- Specified by:
matchesSearchin interfaceConfigEntry
-
resetToDefault
public void resetToDefault()Description copied from interface:ConfigEntryRestores the bound property to its defaultValue() and updates the UI state.- Specified by:
resetToDefaultin interfaceConfigEntry
-
isModified
public boolean isModified()Description copied from interface:ConfigEntryEvaluates if the current UI state differs from the property's defaultValue().- Specified by:
isModifiedin interfaceConfigEntry
-
determineLockState
public static boolean determineLockState(net.minecraft.client.Minecraft minecraft, Property<?> property) -
createWidget
-
updateWidgetValue
protected abstract void updateWidgetValue() -
setValue
-
isDefault
public boolean isDefault() -
canReset
public boolean canReset() -
updateResetButton
protected void updateResetButton() -
getDefaultValueTooltip
protected net.minecraft.network.chat.Component getDefaultValueTooltip() -
getMaxLabelWidth
protected int getMaxLabelWidth(int widgetX) -
extractContent
public void extractContent(@NotNull @NotNull net.minecraft.client.gui.GuiGraphicsExtractor guiGraphicsExtractor, int mouseX, int mouseY, boolean isHovering, float partialTick) -
children
@NotNull public @NotNull List<? extends net.minecraft.client.gui.components.events.GuiEventListener> children()- Specified by:
childrenin interfacenet.minecraft.client.gui.components.events.ContainerEventHandler
-
narratables
@NotNull public @NotNull List<? extends net.minecraft.client.gui.narration.NarratableEntry> narratables()- Specified by:
narratablesin classnet.minecraft.client.gui.components.ContainerObjectSelectionList.Entry<AbstractConfigEntry>
-