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

    Fields
    Modifier and Type
    Field
    Description
    protected final boolean
     
    protected final net.minecraft.network.chat.Component
     
    protected final net.minecraft.client.Minecraft
     
    protected final Runnable
     
    protected final ConfigScreen
     
    protected final Property<T>
     
    protected final net.minecraft.client.gui.components.Button
     
    protected final List<net.minecraft.util.FormattedCharSequence>
     
    protected final W
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    OptionEntry(Property<T> property, ConfigScreen parentScreen, net.minecraft.client.Minecraft minecraft, Runnable onValueChanged)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    @NotNull List<? extends net.minecraft.client.gui.components.events.GuiEventListener>
     
    protected abstract W
     
    void
    extractContent(@NotNull net.minecraft.client.gui.GuiGraphicsExtractor guiGraphicsExtractor, int mouseX, int mouseY, boolean isHovering, float partialTick)
     
    protected net.minecraft.network.chat.Component
     
    boolean
     
    boolean
    Evaluates if the current UI state differs from the property's defaultValue().
    boolean
    Evaluates if the widget matches the current search bar query.
    @NotNull List<? extends net.minecraft.client.gui.narration.NarratableEntry>
     
    void
    Restores the bound property to its defaultValue() and updates the UI state.
    protected void
    setValue(T newValue)
     
    protected void
     
    protected abstract void
     

    Methods inherited from class net.minecraft.client.gui.components.ContainerObjectSelectionList.Entry

    focusPathAtIndex, getFocused, isDragging, mouseClicked, nextFocusPath, setDragging, setFocused

    Methods inherited from class Object

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

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

    charTyped, getBorderForArrowNavigation, getChildAt, getCurrentFocusPath, isFocused, keyPressed, keyReleased, mouseDragged, mouseReleased, mouseScrolled, preeditUpdated, setFocused

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

    getRectangle, isMouseOver, mouseMoved, shouldTakeFocusAfterInteraction

    Methods inherited from interface net.minecraft.client.gui.layouts.LayoutElement

    setPosition

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

    getTabOrderGroup
  • Field Details

    • parentScreen

      protected final ConfigScreen parentScreen
    • property

      protected final Property<T> property
    • resetButton

      protected final net.minecraft.client.gui.components.Button resetButton
    • widget

      protected final W extends net.minecraft.client.gui.components.AbstractWidget widget
    • labelComponent

      protected final net.minecraft.network.chat.Component labelComponent
    • tooltip

      protected final List<net.minecraft.util.FormattedCharSequence> tooltip
    • minecraft

      protected final net.minecraft.client.Minecraft minecraft
    • onValueChanged

      protected final Runnable 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

    • matchesSearch

      public boolean matchesSearch(String query)
      Description copied from interface: ConfigEntry
      Evaluates if the widget matches the current search bar query.
      Specified by:
      matchesSearch in interface ConfigEntry
    • resetToDefault

      public void resetToDefault()
      Description copied from interface: ConfigEntry
      Restores the bound property to its defaultValue() and updates the UI state.
      Specified by:
      resetToDefault in interface ConfigEntry
    • isModified

      public boolean isModified()
      Description copied from interface: ConfigEntry
      Evaluates if the current UI state differs from the property's defaultValue().
      Specified by:
      isModified in interface ConfigEntry
    • createWidget

      protected abstract W createWidget()
    • updateWidgetValue

      protected abstract void updateWidgetValue()
    • setValue

      protected void setValue(T newValue)
    • isDefault

      public boolean isDefault()
    • canReset

      public boolean canReset()
    • updateResetButton

      protected void updateResetButton()
    • getDefaultValueTooltip

      protected net.minecraft.network.chat.Component getDefaultValueTooltip()
    • 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:
      children in interface net.minecraft.client.gui.components.events.ContainerEventHandler
    • narratables

      @NotNull public @NotNull List<? extends net.minecraft.client.gui.narration.NarratableEntry> narratables()
      Specified by:
      narratables in class net.minecraft.client.gui.components.ContainerObjectSelectionList.Entry<AbstractConfigEntry>