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 enq$a
intermediary net/minecraft/class_7172$class_7273
named net/minecraft/client/option/SimpleOption$AlternateValuesSupportingCyclingCallbacks
official a
intermediary comp_671
named values
official b
intermediary comp_672
named altValues
official c
intermediary comp_673
named altCondition
official d
intermediary comp_674
named valueSetter
official e
intermediary comp_675
named codec
  • Field Details

  • Constructor Details

  • Method Details

    • getValues

      public CyclingButtonWidget.Values<T> getValues()
      Specified by:
      getValues in interface SimpleOption.CyclingCallbacks<T>
      Mappings:
      Namespace Name Mixin selector
      official a Lenq$d;a()Lepp$c;
      intermediary method_42721 Lnet/minecraft/class_7172$class_7305;method_42721()Lnet/minecraft/class_5676$class_5680;
      named getValues Lnet/minecraft/client/option/SimpleOption$CyclingCallbacks;getValues()Lnet/minecraft/client/gui/widget/CyclingButtonWidget$Values;
    • validate

      public Optional<T> validate(T value)
      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:
      validate in interface SimpleOption.Callbacks<T>
      Returns:
      the validated value
      Mappings:
      Namespace Name Mixin selector
      official a Lenq$n;a(Ljava/lang/Object;)Ljava/util/Optional;
      intermediary method_41758 Lnet/minecraft/class_7172$class_7178;method_41758(Ljava/lang/Object;)Ljava/util/Optional;
      named validate Lnet/minecraft/client/option/SimpleOption$Callbacks;validate(Ljava/lang/Object;)Ljava/util/Optional;
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • values

      public List<T> values()
      Returns the value of the values record component.
      Returns:
      the value of the values record component
    • altValues

      public List<T> altValues()
      Returns the value of the altValues record component.
      Returns:
      the value of the altValues record component
    • altCondition

      public BooleanSupplier altCondition()
      Returns the value of the altCondition record component.
      Returns:
      the value of the altCondition record component
    • valueSetter

      Specified by:
      valueSetter in interface SimpleOption.CyclingCallbacks<T>
      Mappings:
      Namespace Name Mixin selector
      official e Lenq$d;e()Lenq$d$a;
      intermediary comp_674 Lnet/minecraft/class_7172$class_7305;comp_674()Lnet/minecraft/class_7172$class_7305$class_7274;
      named valueSetter Lnet/minecraft/client/option/SimpleOption$CyclingCallbacks;valueSetter()Lnet/minecraft/client/option/SimpleOption$CyclingCallbacks$ValueSetter;
    • codec

      public com.mojang.serialization.Codec<T> codec()
      Specified by:
      codec in interface SimpleOption.Callbacks<T>
      Mappings:
      Namespace Name Mixin selector
      official f Lenq$n;f()Lcom/mojang/serialization/Codec;
      intermediary comp_675 Lnet/minecraft/class_7172$class_7178;comp_675()Lcom/mojang/serialization/Codec;
      named codec Lnet/minecraft/client/option/SimpleOption$Callbacks;codec()Lcom/mojang/serialization/Codec;