Interface SimpleOption.Callbacks<T>

All Known Subinterfaces:
SimpleOption.CyclingCallbacks<T>, SimpleOption.IntSliderCallbacks, SimpleOption.SliderCallbacks<T>, SimpleOption.TypeChangeableCallbacks<T>
All Known Implementing Classes:
SimpleOption.AlternateValuesSupportingCyclingCallbacks, SimpleOption.DoubleSliderCallbacks, SimpleOption.LazyCyclingCallbacks, SimpleOption.MaxSuppliableIntCallbacks, SimpleOption.PotentialValuesBasedCallbacks, SimpleOption.ValidatingIntSliderCallbacks
Enclosing class:
SimpleOption<T>

@Environment(CLIENT) static interface SimpleOption.Callbacks<T>
A set of callbacks to customize an option's behavior.
See Also:
Mappings:
Namespace Name
official emk$n
intermediary net/minecraft/class_7172$class_7178
named net/minecraft/client/option/SimpleOption$Callbacks
  • Method Details

    • getWidgetCreator

      Function<SimpleOption<T>,ClickableWidget> getWidgetCreator(SimpleOption.TooltipFactory<T> tooltipFactory, GameOptions gameOptions, int x, int y, int width, Consumer<T> changeCallback)
      Returns the widget creator.

      Widget creators are responsible for rendering the option into a ClickableWidget.

      Returns:
      the widget creator
      Mappings:
      Namespace Name Mixin selector
      official a Lemk$n;a(Lemk$l;Leml;IIILjava/util/function/Consumer;)Ljava/util/function/Function;
      intermediary method_41756 Lnet/minecraft/class_7172$class_7178;method_41756(Lnet/minecraft/class_7172$class_7277;Lnet/minecraft/class_315;IIILjava/util/function/Consumer;)Ljava/util/function/Function;
      named getWidgetCreator Lnet/minecraft/client/option/SimpleOption$Callbacks;getWidgetCreator(Lnet/minecraft/client/option/SimpleOption$TooltipFactory;Lnet/minecraft/client/option/GameOptions;IIILjava/util/function/Consumer;)Ljava/util/function/Function;
    • validate

      Optional<T> validate(T value)
      Returns the validated value.

      Returning Optional.empty() indicates the passed value is invalid and it should reset to the default value. This method can also coerce the invalid value into a valid one by clamping, etc.

      Returns:
      the validated value
      Mappings:
      Namespace Name Mixin selector
      official a Lemk$n;a(Ljava/lang/Object;)Ljava/util/Optional;
      intermediary method_41758 Lnet/minecraft/class_7172$class_7178;method_41758(Ljava/lang/Object;)Ljava/util/Optional;
      named validate Lnet/minecraft/client/option/SimpleOption$Callbacks;validate(Ljava/lang/Object;)Ljava/util/Optional;
    • codec

      com.mojang.serialization.Codec<T> codec()
      Mappings:
      Namespace Name Mixin selector
      official f Lemk$n;f()Lcom/mojang/serialization/Codec;
      intermediary comp_675 Lnet/minecraft/class_7172$class_7178;comp_675()Lcom/mojang/serialization/Codec;
      named codec Lnet/minecraft/client/option/SimpleOption$Callbacks;codec()Lcom/mojang/serialization/Codec;