Package net.minecraft.client.option
Record Class SimpleOption.CategoricalSliderCallbacks<T>
java.lang.Object
java.lang.Record
net.minecraft.client.option.SimpleOption.CategoricalSliderCallbacks<T>
- Record Components:
values-codec-
- All Implemented Interfaces:
SimpleOption.Callbacks<T>,SimpleOption.SliderCallbacks<T>
- Enclosing class:
SimpleOption<T>
@Environment(CLIENT)
public static record SimpleOption.CategoricalSliderCallbacks<T>(List<T> values, com.mojang.serialization.Codec<T> codec)
extends Record
implements SimpleOption.SliderCallbacks<T>
- Mappings:
Namespace Name named net/minecraft/client/option/SimpleOption$CategoricalSliderCallbacksintermediary net/minecraft/class_7172$class_12139official gda$jnamed valuesintermediary comp_5052official anamed codecintermediary comp_675official b
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCategoricalSliderCallbacks(List<T> values, com.mojang.serialization.Codec<T> codec) Creates an instance of aCategoricalSliderCallbacksrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<T> codec()Returns the value of thecodecrecord component.final booleanIndicates whether some other object is "equal to" this one.getPrevious(T value) final inthashCode()Returns a hash code value for this object.doubletoSliderProgress(T value) Returns the progress (0.0to1.0, both inclusive) of the slider.final StringtoString()Returns a string representation of this record class.toValue(double sliderProgress) Returns the value from the progress (0.0to1.0, both inclusive) of the slider.Returns the validated value.values()Returns the value of thevaluesrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.client.option.SimpleOption.SliderCallbacks
applyValueImmediately, getWidgetCreator
-
Field Details
-
Constructor Details
-
Method Details
-
toSliderProgress
Returns the progress (0.0to1.0, both inclusive) of the slider.- Specified by:
toSliderProgressin interfaceSimpleOption.SliderCallbacks<T>- Returns:
- the progress (
0.0to1.0, both inclusive) of the slider - Mappings:
Namespace Name Mixin selector named toSliderProgressLnet/minecraft/client/option/SimpleOption$SliderCallbacks;toSliderProgress(Ljava/lang/Object;)Dintermediary method_41765Lnet/minecraft/class_7172$class_7176;method_41765(Ljava/lang/Object;)Dofficial dLgda$l;d(Ljava/lang/Object;)D
-
getNext
- Specified by:
getNextin interfaceSimpleOption.SliderCallbacks<T>- Mappings:
Namespace Name Mixin selector named getNextLnet/minecraft/client/option/SimpleOption$SliderCallbacks;getNext(Ljava/lang/Object;)Ljava/util/Optional;intermediary method_75313Lnet/minecraft/class_7172$class_7176;method_75313(Ljava/lang/Object;)Ljava/util/Optional;official cLgda$l;c(Ljava/lang/Object;)Ljava/util/Optional;
-
getPrevious
- Specified by:
getPreviousin interfaceSimpleOption.SliderCallbacks<T>- Mappings:
Namespace Name Mixin selector named getPreviousLnet/minecraft/client/option/SimpleOption$SliderCallbacks;getPrevious(Ljava/lang/Object;)Ljava/util/Optional;intermediary method_75311Lnet/minecraft/class_7172$class_7176;method_75311(Ljava/lang/Object;)Ljava/util/Optional;official bLgda$l;b(Ljava/lang/Object;)Ljava/util/Optional;
-
toValue
Returns the value from the progress (0.0to1.0, both inclusive) of the slider.- Specified by:
toValuein interfaceSimpleOption.SliderCallbacks<T>- Returns:
- the value from the progress (
0.0to1.0, both inclusive) of the slider - Mappings:
Namespace Name Mixin selector named toValueLnet/minecraft/client/option/SimpleOption$SliderCallbacks;toValue(D)Ljava/lang/Object;intermediary method_41763Lnet/minecraft/class_7172$class_7176;method_41763(D)Ljava/lang/Object;official bLgda$l;b(D)Ljava/lang/Object;
-
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.- Specified by:
validatein interfaceSimpleOption.Callbacks<T>- 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 aLgda$o;a(Ljava/lang/Object;)Ljava/util/Optional;
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
values
Returns the value of thevaluesrecord component.- Returns:
- the value of the
valuesrecord component
-
codec
Returns the value of thecodecrecord component.- Specified by:
codecin interfaceSimpleOption.Callbacks<T>- Returns:
- the value of the
codecrecord component
-