Package net.minecraft.client.option
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>
A set of callbacks to customize an option's behavior.
- See Also:
- Mappings:
Namespace Name named net/minecraft/client/option/SimpleOption$Callbacksintermediary net/minecraft/class_7172$class_7178official fgr$n
-
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<T> codec()getWidgetCreator(SimpleOption.TooltipFactory<T> tooltipFactory, GameOptions gameOptions, int x, int y, int width, Consumer<T> changeCallback) Returns the widget creator.Returns the validated value.
-
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 getWidgetCreatorLnet/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_41756Lnet/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 aLfgr$n;a(Lfgr$l;Lfgs;IIILjava/util/function/Consumer;)Ljava/util/function/Function;
-
validate
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 validateLnet/minecraft/client/option/SimpleOption$Callbacks;validate(Ljava/lang/Object;)Ljava/util/Optional;intermediary method_41758Lnet/minecraft/class_7172$class_7178;method_41758(Ljava/lang/Object;)Ljava/util/Optional;official aLfgr$n;a(Ljava/lang/Object;)Ljava/util/Optional;
-
codec
com.mojang.serialization.Codec<T> codec()- Mappings:
Namespace Name Mixin selector named codecLnet/minecraft/client/option/SimpleOption$Callbacks;codec()Lcom/mojang/serialization/Codec;intermediary comp_675Lnet/minecraft/class_7172$class_7178;comp_675()Lcom/mojang/serialization/Codec;official fLfgr$n;f()Lcom/mojang/serialization/Codec;
-