Package net.minecraft.client.option
Record Class SimpleOption.LazyCyclingCallbacks<T>
java.lang.Object
java.lang.Record
net.minecraft.client.option.SimpleOption.LazyCyclingCallbacks<T>
- Record Components:
- values-
- validateValue-
- codec-
- All Implemented Interfaces:
- SimpleOption.Callbacks<T>,- SimpleOption.CyclingCallbacks<T>
- Enclosing class:
- SimpleOption<T>
@Environment(CLIENT)
public static record SimpleOption.LazyCyclingCallbacks<T>(Supplier<List<T>> values, Function<T,Optional<T>> validateValue, com.mojang.serialization.Codec<T> codec)
extends Record
implements SimpleOption.CyclingCallbacks<T> 
A set of callbacks for a cycling option whose potential values are determined lazily.
- See Also:
- Mappings:
- Namespace - Name - named - net/minecraft/client/option/SimpleOption$LazyCyclingCallbacks- intermediary - net/minecraft/class_7172$class_7276- official - fln$h- named - values- intermediary - comp_676- official - a- named - validateValue- intermediary - comp_677- official - b- named - codec- intermediary - comp_675- official - c
- 
Nested Class SummaryNested classes/interfaces inherited from interface net.minecraft.client.option.SimpleOption.CyclingCallbacksSimpleOption.CyclingCallbacks.ValueSetter<T>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final com.mojang.serialization.Codec<T> The field for thecodecrecord component.The field for thevalidateValuerecord component.The field for thevaluesrecord component.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncom.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.Returns the validated value.Returns the value of thevalidateValuerecord component.values()Returns the value of thevaluesrecord component.Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.client.option.SimpleOption.CyclingCallbacksgetWidgetCreator, valueSetter
- 
Field Details- 
valuesThe field for thevaluesrecord component.
- 
validateValueThe field for thevalidateValuerecord component.
- 
codecThe field for thecodecrecord component.
 
- 
- 
Constructor Details- 
LazyCyclingCallbacks
 
- 
- 
Method Details- 
validateReturns 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 interface- SimpleOption.Callbacks<T>
- Returns:
- the validated value
- Mappings:
- Namespace - Name - Mixin selector - named - validate- Lnet/minecraft/client/option/SimpleOption$Callbacks;validate(Ljava/lang/Object;)Ljava/util/Optional;- intermediary - method_41758- Lnet/minecraft/class_7172$class_7178;method_41758(Ljava/lang/Object;)Ljava/util/Optional;- official - a- Lfln$n;a(Ljava/lang/Object;)Ljava/util/Optional;
 
- 
getValues- Specified by:
- getValuesin interface- SimpleOption.CyclingCallbacks<T>
- Mappings:
- Namespace - Name - Mixin selector - named - getValues- Lnet/minecraft/client/option/SimpleOption$CyclingCallbacks;getValues()Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Values;- intermediary - method_42721- Lnet/minecraft/class_7172$class_7305;method_42721()Lnet/minecraft/class_5676$class_5680;- official - a- Lfln$d;a()Lfpb$c;
 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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).
- 
valuesReturns the value of thevaluesrecord component.- Returns:
- the value of the valuesrecord component
 
- 
validateValueReturns the value of thevalidateValuerecord component.- Returns:
- the value of the validateValuerecord component
 
- 
codecReturns the value of thecodecrecord component.- Specified by:
- codecin interface- SimpleOption.Callbacks<T>
- Returns:
- the value of the codecrecord component
 
 
-