Package net.minecraft.client.gui.widget
Class CyclingButtonWidget.Builder<T>
java.lang.Object
net.minecraft.client.gui.widget.CyclingButtonWidget.Builder<T>
- Enclosing class:
CyclingButtonWidget<T>
A builder to easily create cycling button widgets.
Each builder must have at least one of its
values
methods called
with at least one default (non-alternative) value in the list before
building.- See Also:
- Mappings:
Namespace Name official esx$a
intermediary net/minecraft/class_5676$class_5677
named net/minecraft/client/gui/widget/CyclingButtonWidget$Builder
-
Field Summary
Modifier and TypeFieldDescriptionprivate int
private Function<CyclingButtonWidget<T>,
MutableText> private boolean
private SimpleOption.TooltipFactory<T>
private T
private CyclingButtonWidget.Values<T>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild
(int x, int y, int width, int height, Text optionText, CyclingButtonWidget.UpdateCallback<T> callback) Builds a cycling button widget.Sets the initial value of this button widget.narration
(Function<CyclingButtonWidget<T>, MutableText> narrationMessageFactory) Overrides the narration message of the button to build.Makes the built button omit the option and only display the current value for its text, such as showing "Jump Mode" than "Mode: Jump Mode".tooltip
(SimpleOption.TooltipFactory<T> tooltipFactory) Sets the tooltip factory that provides tooltips for any of the values.values
(Collection<T> values) Sets the option values for this button.Sets the option values for this button.Sets the option values for this button.values
(CyclingButtonWidget.Values<T> values) final CyclingButtonWidget.Builder<T>
Sets the option values for this button.
-
Field Details
-
initialIndex
private int initialIndex- Mappings:
Namespace Name Mixin selector official a
Lesx$a;a:I
intermediary field_27972
Lnet/minecraft/class_5676$class_5677;field_27972:I
named initialIndex
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;initialIndex:I
-
value
- Mappings:
Namespace Name Mixin selector official b
Lesx$a;b:Ljava/lang/Object;
intermediary field_27973
Lnet/minecraft/class_5676$class_5677;field_27973:Ljava/lang/Object;
named value
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;value:Ljava/lang/Object;
-
valueToText
- Mappings:
Namespace Name Mixin selector official c
Lesx$a;c:Ljava/util/function/Function;
intermediary field_27974
Lnet/minecraft/class_5676$class_5677;field_27974:Ljava/util/function/Function;
named valueToText
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;valueToText:Ljava/util/function/Function;
-
tooltipFactory
- Mappings:
Namespace Name Mixin selector official d
Lesx$a;d:Leqy$l;
intermediary field_27975
Lnet/minecraft/class_5676$class_5677;field_27975:Lnet/minecraft/class_7172$class_7277;
named tooltipFactory
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;tooltipFactory:Lnet/minecraft/client/option/SimpleOption$TooltipFactory;
-
narrationMessageFactory
- Mappings:
Namespace Name Mixin selector official e
Lesx$a;e:Ljava/util/function/Function;
intermediary field_27976
Lnet/minecraft/class_5676$class_5677;field_27976:Ljava/util/function/Function;
named narrationMessageFactory
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;narrationMessageFactory:Ljava/util/function/Function;
-
values
- Mappings:
Namespace Name Mixin selector official f
Lesx$a;f:Lesx$c;
intermediary field_27977
Lnet/minecraft/class_5676$class_5677;field_27977:Lnet/minecraft/class_5676$class_5680;
named values
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;values:Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Values;
-
optionTextOmitted
private boolean optionTextOmitted- Mappings:
Namespace Name Mixin selector official g
Lesx$a;g:Z
intermediary field_27978
Lnet/minecraft/class_5676$class_5677;field_27978:Z
named optionTextOmitted
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;optionTextOmitted:Z
-
-
Constructor Details
-
Builder
Creates a builder.- See Also:
- Mappings:
Namespace Name Mixin selector official <init>
Lesx$a;<init>(Ljava/util/function/Function;)V
intermediary <init>
Lnet/minecraft/class_5676$class_5677;<init>(Ljava/util/function/Function;)V
named <init>
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;<init>(Ljava/util/function/Function;)V
-
-
Method Details
-
values
Sets the option values for this button.- Mappings:
Namespace Name Mixin selector official a
Lesx$a;a(Ljava/util/Collection;)Lesx$a;
intermediary method_32620
Lnet/minecraft/class_5676$class_5677;method_32620(Ljava/util/Collection;)Lnet/minecraft/class_5676$class_5677;
named values
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;values(Ljava/util/Collection;)Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;
-
values
Sets the option values for this button.- Mappings:
Namespace Name Mixin selector official a
Lesx$a;a([Ljava/lang/Object;)Lesx$a;
intermediary method_32624
Lnet/minecraft/class_5676$class_5677;method_32624([Ljava/lang/Object;)Lnet/minecraft/class_5676$class_5677;
named values
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;values([Ljava/lang/Object;)Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;
-
values
Sets the option values for this button.When the user presses the ALT key, the
alternatives
values will be iterated; otherwise thedefaults
values will be iterated when clicking the built button.- Mappings:
Namespace Name Mixin selector official a
Lesx$a;a(Ljava/util/List;Ljava/util/List;)Lesx$a;
intermediary method_32621
Lnet/minecraft/class_5676$class_5677;method_32621(Ljava/util/List;Ljava/util/List;)Lnet/minecraft/class_5676$class_5677;
named values
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;values(Ljava/util/List;Ljava/util/List;)Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;
-
values
public CyclingButtonWidget.Builder<T> values(BooleanSupplier alternativeToggle, List<T> defaults, List<T> alternatives) Sets the option values for this button.When
alternativeToggle
getAsBoolean returnstrue
, thealternatives
values will be iterated; otherwise thedefaults
values will be iterated when clicking the built button.- Mappings:
Namespace Name Mixin selector official a
Lesx$a;a(Ljava/util/function/BooleanSupplier;Ljava/util/List;Ljava/util/List;)Lesx$a;
intermediary method_32622
Lnet/minecraft/class_5676$class_5677;method_32622(Ljava/util/function/BooleanSupplier;Ljava/util/List;Ljava/util/List;)Lnet/minecraft/class_5676$class_5677;
named values
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;values(Ljava/util/function/BooleanSupplier;Ljava/util/List;Ljava/util/List;)Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;
-
values
- Mappings:
Namespace Name Mixin selector official a
Lesx$a;a(Lesx$c;)Lesx$a;
intermediary method_42729
Lnet/minecraft/class_5676$class_5677;method_42729(Lnet/minecraft/class_5676$class_5680;)Lnet/minecraft/class_5676$class_5677;
named values
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;values(Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Values;)Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;
-
tooltip
Sets the tooltip factory that provides tooltips for any of the values.If this is not called, the values simply won't have tooltips.
- Mappings:
Namespace Name Mixin selector official a
Lesx$a;a(Leqy$l;)Lesx$a;
intermediary method_32618
Lnet/minecraft/class_5676$class_5677;method_32618(Lnet/minecraft/class_7172$class_7277;)Lnet/minecraft/class_5676$class_5677;
named tooltip
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;tooltip(Lnet/minecraft/client/option/SimpleOption$TooltipFactory;)Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;
-
initially
Sets the initial value of this button widget.This is not effective if
value
is not in the default values (i.e. excluding alternative values).If this is not called, the initial value defaults to the first value in the values list supplied.
- Mappings:
Namespace Name Mixin selector official a
Lesx$a;a(Ljava/lang/Object;)Lesx$a;
intermediary method_32619
Lnet/minecraft/class_5676$class_5677;method_32619(Ljava/lang/Object;)Lnet/minecraft/class_5676$class_5677;
named initially
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;initially(Ljava/lang/Object;)Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;
-
narration
public CyclingButtonWidget.Builder<T> narration(Function<CyclingButtonWidget<T>, MutableText> narrationMessageFactory) Overrides the narration message of the button to build.If this is not called, the button will use
CyclingButtonWidget.getGenericNarrationMessage()
for narration messages.- Mappings:
Namespace Name Mixin selector official a
Lesx$a;a(Ljava/util/function/Function;)Lesx$a;
intermediary method_32623
Lnet/minecraft/class_5676$class_5677;method_32623(Ljava/util/function/Function;)Lnet/minecraft/class_5676$class_5677;
named narration
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;narration(Ljava/util/function/Function;)Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;
-
omitKeyText
Makes the built button omit the option and only display the current value for its text, such as showing "Jump Mode" than "Mode: Jump Mode".- Mappings:
Namespace Name Mixin selector official a
Lesx$a;a()Lesx$a;
intermediary method_32616
Lnet/minecraft/class_5676$class_5677;method_32616()Lnet/minecraft/class_5676$class_5677;
named omitKeyText
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;omitKeyText()Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;
-
build
- Mappings:
Namespace Name Mixin selector official a
Lesx$a;a(IIIILtl;)Lesx;
intermediary method_35723
Lnet/minecraft/class_5676$class_5677;method_35723(IIIILnet/minecraft/class_2561;)Lnet/minecraft/class_5676;
named build
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;build(IIIILnet/minecraft/text/Text;)Lnet/minecraft/client/gui/widget/CyclingButtonWidget;
-
build
public CyclingButtonWidget<T> build(int x, int y, int width, int height, Text optionText, CyclingButtonWidget.UpdateCallback<T> callback) Builds a cycling button widget.- Throws:
IllegalStateException
- if novalues
call is made, or thevalues
has no default values available- Mappings:
Namespace Name Mixin selector official a
Lesx$a;a(IIIILtl;Lesx$b;)Lesx;
intermediary method_32617
Lnet/minecraft/class_5676$class_5677;method_32617(IIIILnet/minecraft/class_2561;Lnet/minecraft/class_5676$class_5678;)Lnet/minecraft/class_5676;
named build
Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;build(IIIILnet/minecraft/text/Text;Lnet/minecraft/client/gui/widget/CyclingButtonWidget$UpdateCallback;)Lnet/minecraft/client/gui/widget/CyclingButtonWidget;
-