Record Class OptionInstance.AltEnum<T>
java.lang.Object
java.lang.Record
net.minecraft.client.OptionInstance.AltEnum<T>
- All Implemented Interfaces:
OptionInstance.CycleableValueSet<T>, OptionInstance.ValueSet<T>
- Enclosing class:
OptionInstance<T>
public static record OptionInstance.AltEnum<T>(List<T> values, List<T> altValues, BooleanSupplier altCondition, OptionInstance.CycleableValueSet.ValueSetter<T> valueSetter, com.mojang.serialization.Codec<T> codec)
extends Record
implements OptionInstance.CycleableValueSet<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface OptionInstance.CycleableValueSet
OptionInstance.CycleableValueSet.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 OptionInstance.CycleableValueSet.ValueSetter<T> The field for thevalueSetterrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionAltEnum(List<T> values, List<T> altValues, BooleanSupplier altCondition, OptionInstance.CycleableValueSet.ValueSetter<T> valueSetter, com.mojang.serialization.Codec<T> codec) Creates an instance of aAltEnumrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealtConditionrecord component.Returns the value of thealtValuesrecord component.com.mojang.serialization.Codec<T> codec()Returns the value of thecodecrecord component.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.validateValue(T value) values()Returns the value of thevaluesrecord component.Returns the value of thevalueSetterrecord component.Methods inherited from interface OptionInstance.CycleableValueSet
createButton
-
Field Details
-
values
-
altValues
-
altCondition
The field for thealtConditionrecord component. -
valueSetter
The field for thevalueSetterrecord component. -
codec
The field for thecodecrecord component.
-
-
Constructor Details
-
AltEnum
public AltEnum(List<T> values, List<T> altValues, BooleanSupplier altCondition, OptionInstance.CycleableValueSet.ValueSetter<T> valueSetter, com.mojang.serialization.Codec<T> codec) Creates an instance of aAltEnumrecord class.- Parameters:
values- the value for thevaluesrecord componentaltValues- the value for thealtValuesrecord componentaltCondition- the value for thealtConditionrecord componentvalueSetter- the value for thevalueSetterrecord componentcodec- the value for thecodecrecord component
-
-
Method Details
-
valueListSupplier
- Specified by:
valueListSupplierin interfaceOptionInstance.CycleableValueSet<T>
-
validateValue
- Specified by:
validateValuein interfaceOptionInstance.ValueSet<T>
-
toString
-
hashCode
-
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
-
altValues
-
altCondition
Returns the value of thealtConditionrecord component.- Returns:
- the value of the
altConditionrecord component
-
valueSetter
Returns the value of thevalueSetterrecord component.- Specified by:
valueSetterin interfaceOptionInstance.CycleableValueSet<T>- Returns:
- the value of the
valueSetterrecord component
-
codec
Returns the value of thecodecrecord component.- Specified by:
codecin interfaceOptionInstance.ValueSet<T>- Returns:
- the value of the
codecrecord component
-