Class CyclingButtonWidget<T>

All Implemented Interfaces:
Drawable, Element, Narratable, Selectable, OrderableTooltip

@Environment(CLIENT) public class CyclingButtonWidget<T> extends PressableWidget implements OrderableTooltip
Mappings:
Namespace Name
official dxf
intermediary net/minecraft/class_5676
named net/minecraft/client/gui/widget/CyclingButtonWidget
  • Field Details

    • HAS_ALT_DOWN

      static final BooleanSupplier HAS_ALT_DOWN
      Mappings:
      Namespace Name Mixin selector
      official a Ldxf;a:Ljava/util/function/BooleanSupplier;
      intermediary field_27961 Lnet/minecraft/class_5676;field_27961:Ljava/util/function/BooleanSupplier;
      named HAS_ALT_DOWN Lnet/minecraft/client/gui/widget/CyclingButtonWidget;HAS_ALT_DOWN:Ljava/util/function/BooleanSupplier;
    • BOOLEAN_VALUES

      private static final List<Boolean> BOOLEAN_VALUES
      Mappings:
      Namespace Name Mixin selector
      official b Ldxf;b:Ljava/util/List;
      intermediary field_27962 Lnet/minecraft/class_5676;field_27962:Ljava/util/List;
      named BOOLEAN_VALUES Lnet/minecraft/client/gui/widget/CyclingButtonWidget;BOOLEAN_VALUES:Ljava/util/List;
    • optionText

      private final Text optionText
      Mappings:
      Namespace Name Mixin selector
      official c Ldxf;c:Los;
      intermediary field_27963 Lnet/minecraft/class_5676;field_27963:Lnet/minecraft/class_2561;
      named optionText Lnet/minecraft/client/gui/widget/CyclingButtonWidget;optionText:Lnet/minecraft/text/Text;
    • index

      private int index
      Mappings:
      Namespace Name Mixin selector
      official d Ldxf;d:I
      intermediary field_27964 Lnet/minecraft/class_5676;field_27964:I
      named index Lnet/minecraft/client/gui/widget/CyclingButtonWidget;index:I
    • value

      private T value
      Mappings:
      Namespace Name Mixin selector
      official e Ldxf;e:Ljava/lang/Object;
      intermediary field_27965 Lnet/minecraft/class_5676;field_27965:Ljava/lang/Object;
      named value Lnet/minecraft/client/gui/widget/CyclingButtonWidget;value:Ljava/lang/Object;
    • values

      private final CyclingButtonWidget.Values<T> values
      Mappings:
      Namespace Name Mixin selector
      official r Ldxf;r:Ldxf$d;
      intermediary field_27966 Lnet/minecraft/class_5676;field_27966:Lnet/minecraft/class_5676$class_5680;
      named values Lnet/minecraft/client/gui/widget/CyclingButtonWidget;values:Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Values;
    • valueToText

      private final Function<T,​Text> valueToText
      Mappings:
      Namespace Name Mixin selector
      official s Ldxf;s:Ljava/util/function/Function;
      intermediary field_27967 Lnet/minecraft/class_5676;field_27967:Ljava/util/function/Function;
      named valueToText Lnet/minecraft/client/gui/widget/CyclingButtonWidget;valueToText:Ljava/util/function/Function;
    • narrationMessageFactory

      private final Function<CyclingButtonWidget<T>,​MutableText> narrationMessageFactory
      Mappings:
      Namespace Name Mixin selector
      official t Ldxf;t:Ljava/util/function/Function;
      intermediary field_27968 Lnet/minecraft/class_5676;field_27968:Ljava/util/function/Function;
      named narrationMessageFactory Lnet/minecraft/client/gui/widget/CyclingButtonWidget;narrationMessageFactory:Ljava/util/function/Function;
    • callback

      private final CyclingButtonWidget.UpdateCallback<T> callback
      Mappings:
      Namespace Name Mixin selector
      official u Ldxf;u:Ldxf$b;
      intermediary field_27969 Lnet/minecraft/class_5676;field_27969:Lnet/minecraft/class_5676$class_5678;
      named callback Lnet/minecraft/client/gui/widget/CyclingButtonWidget;callback:Lnet/minecraft/client/gui/widget/CyclingButtonWidget$UpdateCallback;
    • tooltipFactory

      private final CyclingButtonWidget.TooltipFactory<T> tooltipFactory
      Mappings:
      Namespace Name Mixin selector
      official v Ldxf;v:Ldxf$c;
      intermediary field_27970 Lnet/minecraft/class_5676;field_27970:Lnet/minecraft/class_5676$class_5679;
      named tooltipFactory Lnet/minecraft/client/gui/widget/CyclingButtonWidget;tooltipFactory:Lnet/minecraft/client/gui/widget/CyclingButtonWidget$TooltipFactory;
    • optionTextOmitted

      private final boolean optionTextOmitted
      Mappings:
      Namespace Name Mixin selector
      official w Ldxf;w:Z
      intermediary field_27971 Lnet/minecraft/class_5676;field_27971:Z
      named optionTextOmitted Lnet/minecraft/client/gui/widget/CyclingButtonWidget;optionTextOmitted:Z
  • 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, CyclingButtonWidget.TooltipFactory<T> tooltipFactory, boolean optionTextOmitted)
      Mappings:
      Namespace Name Mixin selector
      official <init> Ldxf;<init>(IIIILos;Los;ILjava/lang/Object;Ldxf$d;Ljava/util/function/Function;Ljava/util/function/Function;Ldxf$b;Ldxf$c;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_5676$class_5679;Z)V
      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/gui/widget/CyclingButtonWidget$TooltipFactory;Z)V
  • Method Details

    • onPress

      public void onPress()
      Specified by:
      onPress in class PressableWidget
      Mappings:
      Namespace Name Mixin selector
      official c Ldwt;c()V
      intermediary method_25306 Lnet/minecraft/class_4264;method_25306()V
      named onPress Lnet/minecraft/client/gui/widget/PressableWidget;onPress()V
    • cycle

      private void cycle(int amount)
      Mappings:
      Namespace Name Mixin selector
      official c Ldxf;c(I)V
      intermediary method_32612 Lnet/minecraft/class_5676;method_32612(I)V
      named cycle Lnet/minecraft/client/gui/widget/CyclingButtonWidget;cycle(I)V
    • getValue

      private T getValue(int offset)
      Mappings:
      Namespace Name Mixin selector
      official e Ldxf;e(I)Ljava/lang/Object;
      intermediary method_37027 Lnet/minecraft/class_5676;method_37027(I)Ljava/lang/Object;
      named getValue Lnet/minecraft/client/gui/widget/CyclingButtonWidget;getValue(I)Ljava/lang/Object;
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double amount)
      Callback for when a mouse button scroll event has been captured.
      Specified by:
      mouseScrolled in interface Element
      Parameters:
      mouseX - the X coordinate of the mouse
      mouseY - the Y coordinate of the mouse
      amount - value is > 1 if scrolled down, < 1 if scrolled up
      Returns:
      true to indicate that the event handling is successful/valid
      See Also:
      Mouse.onMouseScroll(long, double, double)
      Mappings:
      Namespace Name Mixin selector
      official a Ldxx;a(DDD)Z
      intermediary method_25401 Lnet/minecraft/class_364;method_25401(DDD)Z
      named mouseScrolled Lnet/minecraft/client/gui/Element;mouseScrolled(DDD)Z
    • setValue

      public void setValue(T value)
      Mappings:
      Namespace Name Mixin selector
      official a Ldxf;a(Ljava/lang/Object;)V
      intermediary method_32605 Lnet/minecraft/class_5676;method_32605(Ljava/lang/Object;)V
      named setValue Lnet/minecraft/client/gui/widget/CyclingButtonWidget;setValue(Ljava/lang/Object;)V
    • internalSetValue

      private void internalSetValue(T value)
      Mappings:
      Namespace Name Mixin selector
      official b Ldxf;b(Ljava/lang/Object;)V
      intermediary method_32609 Lnet/minecraft/class_5676;method_32609(Ljava/lang/Object;)V
      named internalSetValue Lnet/minecraft/client/gui/widget/CyclingButtonWidget;internalSetValue(Ljava/lang/Object;)V
    • composeText

      private Text composeText(T value)
      Mappings:
      Namespace Name Mixin selector
      official c Ldxf;c(Ljava/lang/Object;)Los;
      intermediary method_37026 Lnet/minecraft/class_5676;method_37026(Ljava/lang/Object;)Lnet/minecraft/class_2561;
      named composeText Lnet/minecraft/client/gui/widget/CyclingButtonWidget;composeText(Ljava/lang/Object;)Lnet/minecraft/text/Text;
    • composeGenericOptionText

      private MutableText composeGenericOptionText(T value)
      Mappings:
      Namespace Name Mixin selector
      official d Ldxf;d(Ljava/lang/Object;)Loy;
      intermediary method_32610 Lnet/minecraft/class_5676;method_32610(Ljava/lang/Object;)Lnet/minecraft/class_5250;
      named composeGenericOptionText Lnet/minecraft/client/gui/widget/CyclingButtonWidget;composeGenericOptionText(Ljava/lang/Object;)Lnet/minecraft/text/MutableText;
    • getValue

      public T getValue()
      Mappings:
      Namespace Name Mixin selector
      official a Ldxf;a()Ljava/lang/Object;
      intermediary method_32603 Lnet/minecraft/class_5676;method_32603()Ljava/lang/Object;
      named getValue Lnet/minecraft/client/gui/widget/CyclingButtonWidget;getValue()Ljava/lang/Object;
    • getNarrationMessage

      protected MutableText getNarrationMessage()
      Overrides:
      getNarrationMessage in class ClickableWidget
      Mappings:
      Namespace Name Mixin selector
      official ak_ Ldwx;ak_()Loy;
      intermediary method_25360 Lnet/minecraft/class_339;method_25360()Lnet/minecraft/class_5250;
      named getNarrationMessage Lnet/minecraft/client/gui/widget/ClickableWidget;getNarrationMessage()Lnet/minecraft/text/MutableText;
    • appendNarrations

      public void appendNarrations(NarrationMessageBuilder builder)
      Specified by:
      appendNarrations in interface Narratable
      Mappings:
      Namespace Name Mixin selector
      official a Ldzd;a(Ldzc;)V
      intermediary method_37020 Lnet/minecraft/class_6383;method_37020(Lnet/minecraft/class_6382;)V
      named appendNarrations Lnet/minecraft/client/gui/Narratable;appendNarrations(Lnet/minecraft/client/gui/screen/narration/NarrationMessageBuilder;)V
    • getGenericNarrationMessage

      public MutableText 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".

      Mappings:
      Namespace Name Mixin selector
      official b Ldxf;b()Loy;
      intermediary method_32611 Lnet/minecraft/class_5676;method_32611()Lnet/minecraft/class_5250;
      named getGenericNarrationMessage Lnet/minecraft/client/gui/widget/CyclingButtonWidget;getGenericNarrationMessage()Lnet/minecraft/text/MutableText;
    • getOrderedTooltip

      public List<OrderedText> getOrderedTooltip()
      Specified by:
      getOrderedTooltip in interface OrderableTooltip
      Mappings:
      Namespace Name Mixin selector
      official j Ldxs;j()Ljava/util/List;
      intermediary method_31047 Lnet/minecraft/class_5499;method_31047()Ljava/util/List;
      named getOrderedTooltip Lnet/minecraft/client/util/OrderableTooltip;getOrderedTooltip()Ljava/util/List;
    • builder

      public static <T> CyclingButtonWidget.Builder<T> builder(Function<T,​Text> valueToText)
      Creates a new builder for a cycling button widget.
      Mappings:
      Namespace Name Mixin selector
      official a Ldxf;a(Ljava/util/function/Function;)Ldxf$a;
      intermediary method_32606 Lnet/minecraft/class_5676;method_32606(Ljava/util/function/Function;)Lnet/minecraft/class_5676$class_5677;
      named builder Lnet/minecraft/client/gui/widget/CyclingButtonWidget;builder(Ljava/util/function/Function;)Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;
    • onOffBuilder

      public 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. It displays on for true and off for false. Its current initial value is true.
      Mappings:
      Namespace Name Mixin selector
      official a Ldxf;a(Los;Los;)Ldxf$a;
      intermediary method_32607 Lnet/minecraft/class_5676;method_32607(Lnet/minecraft/class_2561;Lnet/minecraft/class_2561;)Lnet/minecraft/class_5676$class_5677;
      named onOffBuilder Lnet/minecraft/client/gui/widget/CyclingButtonWidget;onOffBuilder(Lnet/minecraft/text/Text;Lnet/minecraft/text/Text;)Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;
    • onOffBuilder

      public static CyclingButtonWidget.Builder<Boolean> onOffBuilder()
      Creates a builder for a cycling button widget that only has Boolean.TRUE and Boolean.FALSE values. It displays ScreenTexts.ON for true and ScreenTexts.OFF for false. Its current initial value is true.
      Mappings:
      Namespace Name Mixin selector
      official k Ldxf;k()Ldxf$a;
      intermediary method_32614 Lnet/minecraft/class_5676;method_32614()Lnet/minecraft/class_5676$class_5677;
      named onOffBuilder Lnet/minecraft/client/gui/widget/CyclingButtonWidget;onOffBuilder()Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;
    • onOffBuilder

      public static CyclingButtonWidget.Builder<Boolean> onOffBuilder(boolean initialValue)
      Creates a builder for a cycling button widget that only has Boolean.TRUE and Boolean.FALSE values. It displays ScreenTexts.ON for true and ScreenTexts.OFF for false. Its current initial value is set to initialValue.
      Mappings:
      Namespace Name Mixin selector
      official e Ldxf;e(Z)Ldxf$a;
      intermediary method_32613 Lnet/minecraft/class_5676;method_32613(Z)Lnet/minecraft/class_5676$class_5677;
      named onOffBuilder Lnet/minecraft/client/gui/widget/CyclingButtonWidget;onOffBuilder(Z)Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Builder;