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 eey$o
intermediary net/minecraft/class_7172$class_7178
named net/minecraft/client/option/SimpleOption$Callbacks
  • Method Details

    • getButtonCreator

      Function<SimpleOption<T>,ClickableWidget> getButtonCreator(SimpleOption.TooltipFactory<T> tooltipFactory, GameOptions gameOptions, int x, int y, int width)
      Returns the button creator.

      Button creators are responsible for rendering the option.

      Returns:
      the button creator
      Mappings:
      Namespace Name Mixin selector
      official a Leey$o;a(Leey$l;Leez;III)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;III)Ljava/util/function/Function;
      named getButtonCreator Lnet/minecraft/client/option/SimpleOption$Callbacks;getButtonCreator(Lnet/minecraft/client/option/SimpleOption$TooltipFactory;Lnet/minecraft/client/option/GameOptions;III)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 Leey$o;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 Leey$o;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;