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
named net/minecraft/client/option/SimpleOption$Callbacks
intermediary net/minecraft/class_7172$class_7178
official ffk$n
  • 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
      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;
      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;
      official a Lffk$n;a(Lffk$l;Lffl;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
      named validate Lnet/minecraft/client/option/SimpleOption$Callbacks;validate(Ljava/lang/Object;)Ljava/util/Optional;
      intermediary method_41758 Lnet/minecraft/class_7172$class_7178;method_41758(Ljava/lang/Object;)Ljava/util/Optional;
      official a Lffk$n;a(Ljava/lang/Object;)Ljava/util/Optional;
    • codec

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