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
(package private) static interface
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority
-
Field Summary
Modifier and TypeFieldDescription(package private) static BooleanSupplier
private boolean
private int
private Component
private Function<CycleButton<T>,MutableComponent>
private CycleButton.OnValueChange<T>
private CycleButton.TooltipSupplier<T>
private T
private 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
-
Constructor Summary
ConstructorDescriptionCycleButton(int p_168869_, int p_168870_, int p_168871_, int p_168872_, Component p_168873_, Component p_168874_, int p_168875_, T p_168876_, CycleButton.ValueListSupplier<T> p_168877_, Function<T,Component> p_168878_, Function<CycleButton<T>,MutableComponent> p_168879_, CycleButton.OnValueChange<T> p_168880_, CycleButton.TooltipSupplier<T> p_168881_, boolean p_168882_)
-
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, isHovered, 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, drawCenteredString, drawCenteredString, drawCenteredString, drawString, drawString, drawString, 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_168869_, int p_168870_, int p_168871_, int p_168872_, Component p_168873_, Component p_168874_, int p_168875_, T p_168876_, CycleButton.ValueListSupplier<T> p_168877_, Function<T,Component> p_168878_, Function<CycleButton<T>,MutableComponent> p_168879_, CycleButton.OnValueChange<T> p_168880_, CycleButton.TooltipSupplier<T> p_168881_, boolean p_168882_)
-
-
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
public static CycleButton.Builder<Boolean> booleanBuilder(Component p_168897_, Component p_168898_) -
onOffBuilder
-
onOffBuilder
-