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
- 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 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 WFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
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 abstract Wprotected net.minecraft.network.chat.ComponentbooleanbooleanEvaluates 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> voidrender(@NotNull net.minecraft.client.gui.GuiGraphics guiGraphics, int index, int top, int left, int width, int height, int mouseX, int mouseY, boolean hovering, float partialTick) 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
charTyped, getChildAt, getCurrentFocusPath, isFocused, keyPressed, keyReleased, mouseDragged, mouseReleased, mouseScrolled, setFocusedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getBorderForArrowNavigation, getRectangle, isMouseOver, mouseMovedMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
parentScreen
-
property
-
resetButton
protected final net.minecraft.client.gui.components.Button resetButton -
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
-
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
-
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() -
render
public void render(@NotNull @NotNull net.minecraft.client.gui.GuiGraphics guiGraphics, int index, int top, int left, int width, int height, int mouseX, int mouseY, boolean hovering, 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>
-