Class CycleButton<T>
java.lang.Object
net.minecraft.client.gui.GuiComponent
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractButton
net.minecraft.client.gui.components.CycleButton<T>
- All Implemented Interfaces:
GuiEventListener
,TooltipAccessor
,Widget
,NarratableEntry
,NarrationSupplier
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static interface
static interface
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority
-
Field Summary
Modifier and TypeFieldDescription(package private) static final BooleanSupplier
private final boolean
private int
private final Component
private final Function<CycleButton<T>,
MutableComponent> private final CycleButton.OnValueChange<T>
private final OptionInstance.TooltipSupplier<T>
private T
private final CycleButton.ValueListSupplier<T>
Fields inherited from class net.minecraft.client.gui.components.AbstractWidget
active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, WIDGETS_LOCATION, width, x, y
Fields inherited from class net.minecraft.client.gui.GuiComponent
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
ConstructorDescriptionCycleButton
(int p_232484_, int p_232485_, int p_232486_, int p_232487_, Component p_232488_, Component p_232489_, int p_232490_, T p_232491_, CycleButton.ValueListSupplier<T> p_232492_, Function<T, Component> p_232493_, Function<CycleButton<T>, MutableComponent> p_232494_, CycleButton.OnValueChange<T> p_232495_, OptionInstance.TooltipSupplier<T> p_232496_, boolean p_232497_) -
Method Summary
Modifier and TypeMethodDescriptionstatic CycleButton.Builder<Boolean>
booleanBuilder
(Component p_168897_, Component p_168898_) static <T> CycleButton.Builder<T>
private MutableComponent
createFullName
(T p_168913_) private Component
createLabelForValue
(T p_168911_) protected MutableComponent
private void
cycleValue
(int p_168909_) private T
getCycledValue
(int p_168915_) getValue()
boolean
mouseScrolled
(double p_168885_, double p_168886_, double p_168887_) static CycleButton.Builder<Boolean>
static CycleButton.Builder<Boolean>
onOffBuilder
(boolean p_168917_) void
onPress()
void
void
updateNarration
(NarrationElementOutput p_168889_) private void
updateValue
(T p_168906_) Methods inherited from class net.minecraft.client.gui.components.AbstractButton
keyPressed, onClick
Methods inherited from class net.minecraft.client.gui.components.AbstractWidget
changeFocus, clearFGColor, clicked, defaultButtonNarrationText, getFGColor, getHeight, getMessage, getWidth, getYImage, isActive, isFocused, isHoveredOrFocused, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrationPriority, onDrag, onFocusedChanged, onRelease, playDownSound, render, renderBg, renderButton, renderToolTip, setAlpha, setFGColor, setFocused, setHeight, setMessage, setWidth, wrapDefaultNarrationMessage
Methods inherited from class net.minecraft.client.gui.GuiComponent
blit, blit, blit, blit, blit, blitOutlineBlack, disableScissor, drawCenteredString, drawCenteredString, drawCenteredString, drawString, drawString, drawString, enableScissor, fill, fillGradient, fillGradient, fillGradient, getBlitOffset, hLine, setBlitOffset, vLine
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
charTyped, keyReleased, mouseMoved
-
Field Details
-
DEFAULT_ALT_LIST_SELECTOR
-
BOOLEAN_OPTIONS
-
name
-
index
private int index -
value
-
values
-
valueStringifier
-
narrationProvider
-
onValueChange
-
tooltipSupplier
-
displayOnlyValue
private final boolean displayOnlyValue
-
-
Constructor Details
-
CycleButton
CycleButton(int p_232484_, int p_232485_, int p_232486_, int p_232487_, Component p_232488_, Component p_232489_, int p_232490_, T p_232491_, CycleButton.ValueListSupplier<T> p_232492_, Function<T, Component> p_232493_, Function<CycleButton<T>, MutableComponent> p_232494_, CycleButton.OnValueChange<T> p_232495_, OptionInstance.TooltipSupplier<T> p_232496_, boolean p_232497_)
-
-
Method Details
-
onPress
public void onPress()- Specified by:
onPress
in classAbstractButton
-
cycleValue
private void cycleValue(int p_168909_) -
getCycledValue
-
mouseScrolled
public boolean mouseScrolled(double p_168885_, double p_168886_, double p_168887_) - Specified by:
mouseScrolled
in interfaceGuiEventListener
-
setValue
-
updateValue
-
createLabelForValue
-
createFullName
-
getValue
-
createNarrationMessage
- Overrides:
createNarrationMessage
in classAbstractWidget
-
updateNarration
- Specified by:
updateNarration
in interfaceNarrationSupplier
-
createDefaultNarrationMessage
-
getTooltip
- Specified by:
getTooltip
in interfaceTooltipAccessor
-
builder
-
booleanBuilder
-
onOffBuilder
-
onOffBuilder
-