Package net.minecraft.client.gui.widget
Class CyclingButtonWidget<T>
java.lang.Object
net.minecraft.client.gui.widget.ClickableWidget
net.minecraft.client.gui.widget.PressableWidget
net.minecraft.client.gui.widget.CyclingButtonWidget<T>
- All Implemented Interfaces:
Drawable
,Element
,Narratable
,Navigable
,Selectable
,Widget
- Mappings:
Namespace Name named net/minecraft/client/gui/widget/CyclingButtonWidget
intermediary net/minecraft/class_5676
official fin
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A builder to easily create cycling button widgets.static interface
static interface
Nested classes/interfaces inherited from interface net.minecraft.client.gui.Selectable
Selectable.SelectionType
-
Field Summary
Modifier and TypeFieldDescriptionprivate final CyclingButtonWidget.UpdateCallback
<T> static final BooleanSupplier
private int
private final Function
<CyclingButtonWidget<T>, MutableText> private final Text
private final boolean
private final SimpleOption.TooltipFactory
<T> private T
private final CyclingButtonWidget.Values
<T> Fields inherited from class net.minecraft.client.gui.widget.PressableWidget
field_43050
Fields inherited from class net.minecraft.client.gui.widget.ClickableWidget
active, alpha, height, hovered, visible, width
Fields inherited from interface net.minecraft.client.gui.Element
MAX_DOUBLE_CLICK_INTERVAL
-
Constructor Summary
ConstructorDescriptionCyclingButtonWidget
(int x, int y, int width, int height, Text message, Text optionText, int index, T value, CyclingButtonWidget.Values<T> values, Function<T, Text> valueToText, Function<CyclingButtonWidget<T>, MutableText> narrationMessageFactory, CyclingButtonWidget.UpdateCallback<T> callback, SimpleOption.TooltipFactory<T> tooltipFactory, boolean optionTextOmitted) -
Method Summary
Modifier and TypeMethodDescriptionvoid
static <T> CyclingButtonWidget.Builder
<T> Creates a new builder for a cycling button widget.private MutableText
composeGenericOptionText
(T value) private Text
composeText
(T value) private void
cycle
(int amount) Returns a generic narration message for this button.protected MutableText
getValue()
private T
getValue
(int offset) private void
internalSetValue
(T value) boolean
mouseScrolled
(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) Callback for when a mouse button scroll event has been captured.static CyclingButtonWidget.Builder
<Boolean> Creates a builder for a cycling button widget that only has Boolean.TRUE and Boolean.FALSE values.static CyclingButtonWidget.Builder
<Boolean> onOffBuilder
(boolean initialValue) Creates a builder for a cycling button widget that only has Boolean.TRUE and Boolean.FALSE values.static CyclingButtonWidget.Builder
<Boolean> onOffBuilder
(Text on, Text off) Creates a builder for a cycling button widget that only has Boolean.TRUE and Boolean.FALSE values.void
onPress()
private void
void
Methods inherited from class net.minecraft.client.gui.widget.PressableWidget
drawMessage, keyPressed, onClick, renderWidget
Methods inherited from class net.minecraft.client.gui.widget.ClickableWidget
appendDefaultNarrations, appendNarrations, clicked, drawScrollableText, drawScrollableText, drawScrollableText, forEachChild, getBottom, getHeight, getMessage, getNarrationMessage, getNavigationFocus, getNavigationOrder, getNavigationPath, getRight, getTooltip, getType, getWidth, getX, getY, isFocused, isHovered, isMouseOver, isNarratable, isSelected, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, onDrag, onRelease, playDownSound, render, setAlpha, setDimensions, setDimensionsAndPosition, setFocused, setHeight, setMessage, setNavigationOrder, setTooltip, setTooltipDelay, setWidth, setX, setY
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.Element
charTyped, getFocusedPath, keyReleased, mouseMoved
Methods inherited from interface net.minecraft.client.gui.widget.Widget
setPosition
-
Field Details
-
HAS_ALT_DOWN
- Mappings:
Namespace Name Mixin selector named HAS_ALT_DOWN
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;HAS_ALT_DOWN:Ljava/util/function/BooleanSupplier;
intermediary field_27961
Lnet/minecraft/class_5676;field_27961:Ljava/util/function/BooleanSupplier;
official a
Lfin;a:Ljava/util/function/BooleanSupplier;
-
BOOLEAN_VALUES
- Mappings:
Namespace Name Mixin selector named BOOLEAN_VALUES
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;BOOLEAN_VALUES:Ljava/util/List;
intermediary field_27962
Lnet/minecraft/class_5676;field_27962:Ljava/util/List;
official b
Lfin;b:Ljava/util/List;
-
optionText
- Mappings:
Namespace Name Mixin selector named optionText
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;optionText:Lnet/minecraft/text/Text;
intermediary field_27963
Lnet/minecraft/class_5676;field_27963:Lnet/minecraft/class_2561;
official c
Lfin;c:Lwy;
-
index
private int index- Mappings:
Namespace Name Mixin selector named index
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;index:I
intermediary field_27964
Lnet/minecraft/class_5676;field_27964:I
official d
Lfin;d:I
-
value
- Mappings:
Namespace Name Mixin selector named value
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;value:Ljava/lang/Object;
intermediary field_27965
Lnet/minecraft/class_5676;field_27965:Ljava/lang/Object;
official f
Lfin;f:Ljava/lang/Object;
-
values
- Mappings:
Namespace Name Mixin selector named values
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;values:Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Values;
intermediary field_27966
Lnet/minecraft/class_5676;field_27966:Lnet/minecraft/class_5676$class_5680;
official m
Lfin;m:Lfin$c;
-
valueToText
- Mappings:
Namespace Name Mixin selector named valueToText
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;valueToText:Ljava/util/function/Function;
intermediary field_27967
Lnet/minecraft/class_5676;field_27967:Ljava/util/function/Function;
official n
Lfin;n:Ljava/util/function/Function;
-
narrationMessageFactory
- Mappings:
Namespace Name Mixin selector named narrationMessageFactory
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;narrationMessageFactory:Ljava/util/function/Function;
intermediary field_27968
Lnet/minecraft/class_5676;field_27968:Ljava/util/function/Function;
official o
Lfin;o:Ljava/util/function/Function;
-
callback
- Mappings:
Namespace Name Mixin selector named callback
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;callback:Lnet/minecraft/client/gui/widget/CyclingButtonWidget$UpdateCallback;
intermediary field_27969
Lnet/minecraft/class_5676;field_27969:Lnet/minecraft/class_5676$class_5678;
official p
Lfin;p:Lfin$b;
-
optionTextOmitted
private final boolean optionTextOmitted- Mappings:
Namespace Name Mixin selector named optionTextOmitted
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;optionTextOmitted:Z
intermediary field_27971
Lnet/minecraft/class_5676;field_27971:Z
official q
Lfin;q:Z
-
tooltipFactory
- Mappings:
Namespace Name Mixin selector named tooltipFactory
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;tooltipFactory:Lnet/minecraft/client/option/SimpleOption$TooltipFactory;
intermediary field_27970
Lnet/minecraft/class_5676;field_27970:Lnet/minecraft/class_7172$class_7277;
official r
Lfin;r:Lfgl$l;
-
-
Constructor Details
-
CyclingButtonWidget
CyclingButtonWidget(int x, int y, int width, int height, Text message, Text optionText, int index, T value, CyclingButtonWidget.Values<T> values, Function<T, Text> valueToText, Function<CyclingButtonWidget<T>, MutableText> narrationMessageFactory, CyclingButtonWidget.UpdateCallback<T> callback, SimpleOption.TooltipFactory<T> tooltipFactory, boolean optionTextOmitted) - Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;<init>(IIIILnet/minecraft/text/Text;Lnet/minecraft/text/Text;ILjava/lang/Object;Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Values;Ljava/util/function/Function;Ljava/util/function/Function;Lnet/minecraft/client/gui/widget/CyclingButtonWidget$UpdateCallback;Lnet/minecraft/client/option/SimpleOption$TooltipFactory;Z)V
intermediary <init>
Lnet/minecraft/class_5676;<init>(IIIILnet/minecraft/class_2561;Lnet/minecraft/class_2561;ILjava/lang/Object;Lnet/minecraft/class_5676$class_5680;Ljava/util/function/Function;Ljava/util/function/Function;Lnet/minecraft/class_5676$class_5678;Lnet/minecraft/class_7172$class_7277;Z)V
official <init>
Lfin;<init>(IIIILwy;Lwy;ILjava/lang/Object;Lfin$c;Ljava/util/function/Function;Ljava/util/function/Function;Lfin$b;Lfgl$l;Z)V
-
-
Method Details
-
refreshTooltip
private void refreshTooltip()- Mappings:
Namespace Name Mixin selector named refreshTooltip
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;refreshTooltip()V
intermediary method_47403
Lnet/minecraft/class_5676;method_47403()V
official f
Lfin;f()V
-
onPress
public void onPress()- Specified by:
onPress
in classPressableWidget
- Mappings:
Namespace Name Mixin selector named onPress
Lnet/minecraft/client/gui/widget/PressableWidget;onPress()V
intermediary method_25306
Lnet/minecraft/class_4264;method_25306()V
official b
Lfhx;b()V
-
cycle
private void cycle(int amount) - Mappings:
Namespace Name Mixin selector named cycle
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;cycle(I)V
intermediary method_32612
Lnet/minecraft/class_5676;method_32612(I)V
official a
Lfin;a(I)V
-
getValue
- Mappings:
Namespace Name Mixin selector named getValue
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;getValue(I)Ljava/lang/Object;
intermediary method_37027
Lnet/minecraft/class_5676;method_37027(I)Ljava/lang/Object;
official b
Lfin;b(I)Ljava/lang/Object;
-
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) Callback for when a mouse button scroll event has been captured.- Parameters:
mouseX
- the X coordinate of the mousemouseY
- the Y coordinate of the mousehorizontalAmount
- the horizontal scroll amountverticalAmount
- the vertical scroll amount- Returns:
true
to indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector named mouseScrolled
Lnet/minecraft/client/gui/Element;mouseScrolled(DDDD)Z
intermediary method_25401
Lnet/minecraft/class_364;method_25401(DDDD)Z
official a
Lfkc;a(DDDD)Z
-
setValue
- Mappings:
Namespace Name Mixin selector named setValue
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;setValue(Ljava/lang/Object;)V
intermediary method_32605
Lnet/minecraft/class_5676;method_32605(Ljava/lang/Object;)V
official a
Lfin;a(Ljava/lang/Object;)V
-
internalSetValue
- Mappings:
Namespace Name Mixin selector named internalSetValue
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;internalSetValue(Ljava/lang/Object;)V
intermediary method_32609
Lnet/minecraft/class_5676;method_32609(Ljava/lang/Object;)V
official b
Lfin;b(Ljava/lang/Object;)V
-
composeText
- Mappings:
Namespace Name Mixin selector named composeText
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;composeText(Ljava/lang/Object;)Lnet/minecraft/text/Text;
intermediary method_37026
Lnet/minecraft/class_5676;method_37026(Ljava/lang/Object;)Lnet/minecraft/class_2561;
official c
Lfin;c(Ljava/lang/Object;)Lwy;
-
composeGenericOptionText
- Mappings:
Namespace Name Mixin selector named composeGenericOptionText
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;composeGenericOptionText(Ljava/lang/Object;)Lnet/minecraft/text/MutableText;
intermediary method_32610
Lnet/minecraft/class_5676;method_32610(Ljava/lang/Object;)Lnet/minecraft/class_5250;
official d
Lfin;d(Ljava/lang/Object;)Lxm;
-
getValue
- Mappings:
Namespace Name Mixin selector named getValue
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;getValue()Ljava/lang/Object;
intermediary method_32603
Lnet/minecraft/class_5676;method_32603()Ljava/lang/Object;
official a
Lfin;a()Ljava/lang/Object;
-
getNarrationMessage
- Overrides:
getNarrationMessage
in classClickableWidget
- Mappings:
Namespace Name Mixin selector named getNarrationMessage
Lnet/minecraft/client/gui/widget/ClickableWidget;getNarrationMessage()Lnet/minecraft/text/MutableText;
intermediary method_25360
Lnet/minecraft/class_339;method_25360()Lnet/minecraft/class_5250;
official aM_
Lfie;aM_()Lxm;
-
appendClickableNarrations
- Specified by:
appendClickableNarrations
in classClickableWidget
- Mappings:
Namespace Name Mixin selector named appendClickableNarrations
Lnet/minecraft/client/gui/widget/ClickableWidget;appendClickableNarrations(Lnet/minecraft/client/gui/screen/narration/NarrationMessageBuilder;)V
intermediary method_47399
Lnet/minecraft/class_339;method_47399(Lnet/minecraft/class_6382;)V
official a
Lfie;a(Lfmc;)V
-
getGenericNarrationMessage
Returns a generic narration message for this button.If the button omits the option text in rendering, such as showing only "Value", this narration message will still read out the option like "Option: Value".
- Returns:
- a generic narration message for this button
- Mappings:
Namespace Name Mixin selector named getGenericNarrationMessage
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;getGenericNarrationMessage()Lnet/minecraft/text/MutableText;
intermediary method_32611
Lnet/minecraft/class_5676;method_32611()Lnet/minecraft/class_5250;
official c
Lfin;c()Lxm;
-
builder
Creates a new builder for a cycling button widget.- Mappings:
Namespace Name Mixin selector named builder
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;builder(Ljava/util/function/Function;)Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;
intermediary method_32606
Lnet/minecraft/class_5676;method_32606(Ljava/util/function/Function;)Lnet/minecraft/class_5676$class_5677;
official a
Lfin;a(Ljava/util/function/Function;)Lfin$a;
-
onOffBuilder
Creates a builder for a cycling button widget that only has Boolean.TRUE and Boolean.FALSE values. It displayson
fortrue
andoff
forfalse
. Its current initial value istrue
.- Mappings:
Namespace Name Mixin selector named onOffBuilder
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;onOffBuilder(Lnet/minecraft/text/Text;Lnet/minecraft/text/Text;)Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;
intermediary method_32607
Lnet/minecraft/class_5676;method_32607(Lnet/minecraft/class_2561;Lnet/minecraft/class_2561;)Lnet/minecraft/class_5676$class_5677;
official a
Lfin;a(Lwy;Lwy;)Lfin$a;
-
onOffBuilder
Creates a builder for a cycling button widget that only has Boolean.TRUE and Boolean.FALSE values. It displaysScreenTexts.ON
fortrue
andScreenTexts.OFF
forfalse
. Its current initial value istrue
.- Mappings:
Namespace Name Mixin selector named onOffBuilder
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;onOffBuilder()Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;
intermediary method_32614
Lnet/minecraft/class_5676;method_32614()Lnet/minecraft/class_5676$class_5677;
official e
Lfin;e()Lfin$a;
-
onOffBuilder
Creates a builder for a cycling button widget that only has Boolean.TRUE and Boolean.FALSE values. It displaysScreenTexts.ON
fortrue
andScreenTexts.OFF
forfalse
. Its current initial value is set toinitialValue
.- Mappings:
Namespace Name Mixin selector named onOffBuilder
Lnet/minecraft/client/gui/widget/CyclingButtonWidget;onOffBuilder(Z)Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;
intermediary method_32613
Lnet/minecraft/class_5676;method_32613(Z)Lnet/minecraft/class_5676$class_5677;
official b
Lfin;b(Z)Lfin$a;
-