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
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic interface(package private) static interfaceNested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static BooleanSupplierprivate booleanprivate intprivate Componentprivate Function<CycleButton<T>,MutableComponent>private CycleButton.OnValueChange<T>private CycleButton.TooltipSupplier<T>private Tprivate 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, yFields inherited from class net.minecraft.client.gui.GuiComponent
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION -
Constructor Summary
ConstructorsConstructorDescriptionCycleButton(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 MutableComponentcreateFullName(T p_168913_)private ComponentcreateLabelForValue(T p_168911_)protected MutableComponentprivate voidcycleValue(int p_168909_)private TgetCycledValue(int p_168915_)getValue()booleanmouseScrolled(double p_168885_, double p_168886_, double p_168887_)static CycleButton.Builder<Boolean>static CycleButton.Builder<Boolean>onOffBuilder(boolean p_168917_)voidonPress()voidvoidupdateNarration(NarrationElementOutput p_168889_)private voidupdateValue(T p_168906_)Methods inherited from class net.minecraft.client.gui.components.AbstractButton
keyPressed, onClickMethods 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, wrapDefaultNarrationMessageMethods 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, vLineMethods 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.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:
onPressin classAbstractButton
-
cycleValue
private void cycleValue(int p_168909_) -
getCycledValue
-
mouseScrolled
public boolean mouseScrolled(double p_168885_, double p_168886_, double p_168887_)- Specified by:
mouseScrolledin interfaceGuiEventListener
-
setValue
-
updateValue
-
createLabelForValue
-
createFullName
-
getValue
-
createNarrationMessage
- Overrides:
createNarrationMessagein classAbstractWidget
-
updateNarration
- Specified by:
updateNarrationin interfaceNarrationSupplier
-
createDefaultNarrationMessage
-
getTooltip
- Specified by:
getTooltipin interfaceTooltipAccessor
-
builder
-
booleanBuilder
public static CycleButton.Builder<Boolean> booleanBuilder(Component p_168897_, Component p_168898_) -
onOffBuilder
-
onOffBuilder
-