Package net.minecraft.client.option
Record Class SimpleOption.AlternateValuesSupportingCyclingCallbacks<T>
java.lang.Object
java.lang.Record
net.minecraft.client.option.SimpleOption.AlternateValuesSupportingCyclingCallbacks<T>
- Record Components:
values-altValues-altCondition-valueSetter-codec-
- All Implemented Interfaces:
SimpleOption.Callbacks<T>,SimpleOption.CyclingCallbacks<T>
- Enclosing class:
SimpleOption<T>
@Environment(CLIENT)
public static record SimpleOption.AlternateValuesSupportingCyclingCallbacks<T>(List<T> values, List<T> altValues, BooleanSupplier altCondition, SimpleOption.CyclingCallbacks.ValueSetter<T> valueSetter, com.mojang.serialization.Codec<T> codec)
extends Record
implements SimpleOption.CyclingCallbacks<T>
A set of callbacks for a cycling option with alternate potential values that are used
only when certain conditions are met.
- See Also:
- Mappings:
Namespace Name official eni$aintermediary net/minecraft/class_7172$class_7273named net/minecraft/client/option/SimpleOption$AlternateValuesSupportingCyclingCallbacksofficial aintermediary comp_671named valuesofficial bintermediary comp_672named altValuesofficial cintermediary comp_673named altConditionofficial dintermediary comp_674named valueSetterofficial eintermediary comp_675named codec
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.option.SimpleOption.CyclingCallbacks
SimpleOption.CyclingCallbacks.ValueSetter<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BooleanSupplierThe field for thealtConditionrecord component.The field for thealtValuesrecord component.private final com.mojang.serialization.Codec<T>The field for thecodecrecord component.The field for thevaluesrecord component.private final SimpleOption.CyclingCallbacks.ValueSetter<T>The field for thevalueSetterrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionAlternateValuesSupportingCyclingCallbacks(List<T> list, List<T> list2, BooleanSupplier booleanSupplier, SimpleOption.CyclingCallbacks.ValueSetter<T> valueSetter, com.mojang.serialization.Codec<T> codec) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealtConditionrecord component.Returns the value of thealtValuesrecord component.com.mojang.serialization.Codec<T>codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.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.CyclingCallbacks
getWidgetCreator
-
Field Details
-
values
The field for thevaluesrecord component. -
altValues
The field for thealtValuesrecord component. -
altCondition
The field for thealtConditionrecord component. -
valueSetter
The field for thevalueSetterrecord component. -
codec
The field for thecodecrecord component.
-
-
Constructor Details
-
AlternateValuesSupportingCyclingCallbacks
public AlternateValuesSupportingCyclingCallbacks(List<T> list, List<T> list2, BooleanSupplier booleanSupplier, SimpleOption.CyclingCallbacks.ValueSetter<T> valueSetter, com.mojang.serialization.Codec<T> codec)
-
-
Method Details
-
getValues
- Specified by:
getValuesin interfaceSimpleOption.CyclingCallbacks<T>- Mappings:
Namespace Name Mixin selector official aLeni$d;a()Leph$c;intermediary method_42721Lnet/minecraft/class_7172$class_7305;method_42721()Lnet/minecraft/class_5676$class_5680;named getValuesLnet/minecraft/client/option/SimpleOption$CyclingCallbacks;getValues()Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Values;
-
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 official aLeni$n;a(Ljava/lang/Object;)Ljava/util/Optional;intermediary method_41758Lnet/minecraft/class_7172$class_7178;method_41758(Ljava/lang/Object;)Ljava/util/Optional;named validateLnet/minecraft/client/option/SimpleOption$Callbacks;validate(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
-
altValues
Returns the value of thealtValuesrecord component.- Returns:
- the value of the
altValuesrecord component
-
altCondition
Returns the value of thealtConditionrecord component.- Returns:
- the value of the
altConditionrecord component
-
valueSetter
- Specified by:
valueSetterin interfaceSimpleOption.CyclingCallbacks<T>- Mappings:
Namespace Name Mixin selector official eLeni$d;e()Leni$d$a;intermediary comp_674Lnet/minecraft/class_7172$class_7305;comp_674()Lnet/minecraft/class_7172$class_7305$class_7274;named valueSetterLnet/minecraft/client/option/SimpleOption$CyclingCallbacks;valueSetter()Lnet/minecraft/client/option/SimpleOption$CyclingCallbacks$ValueSetter;
-
codec
- Specified by:
codecin interfaceSimpleOption.Callbacks<T>- Mappings:
Namespace Name Mixin selector official fLeni$n;f()Lcom/mojang/serialization/Codec;intermediary comp_675Lnet/minecraft/class_7172$class_7178;comp_675()Lcom/mojang/serialization/Codec;named codecLnet/minecraft/client/option/SimpleOption$Callbacks;codec()Lcom/mojang/serialization/Codec;
-