Record Class SimpleOption.MaxSuppliableIntCallbacks

java.lang.Object
java.lang.Record
net.minecraft.client.option.SimpleOption.MaxSuppliableIntCallbacks
Record Components:
minInclusive -
maxSupplier -
encodableMaxInclusive -
All Implemented Interfaces:
SimpleOption.Callbacks<Integer>, SimpleOption.CyclingCallbacks<Integer>, SimpleOption.IntSliderCallbacks, SimpleOption.SliderCallbacks<Integer>, SimpleOption.TypeChangeableCallbacks<Integer>
Enclosing class:
SimpleOption<T>

@Environment(CLIENT) public static record SimpleOption.MaxSuppliableIntCallbacks(int minInclusive, IntSupplier maxSupplier, int encodableMaxInclusive) extends Record implements SimpleOption.IntSliderCallbacks, SimpleOption.TypeChangeableCallbacks<Integer>
A set of callbacks for a cycling option with a fixed minimum value and a dynamic maximum value. This clamps the value during validation.
See Also:
Mappings:
Namespace Name
official eqy$c
intermediary net/minecraft/class_7172$class_7304
named net/minecraft/client/option/SimpleOption$MaxSuppliableIntCallbacks
official a
intermediary comp_593
named minInclusive
official b
intermediary comp_690
named maxSupplier
official c
intermediary comp_1316
named encodableMaxInclusive
  • Field Details

    • minInclusive

      private final int minInclusive
      The field for the minInclusive record component.
    • maxSupplier

      private final IntSupplier maxSupplier
      The field for the maxSupplier record component.
    • encodableMaxInclusive

      private final int encodableMaxInclusive
      The field for the encodableMaxInclusive record component.
  • Constructor Details

    • MaxSuppliableIntCallbacks

      public MaxSuppliableIntCallbacks(int int2, IntSupplier intSupplier, int int3)
  • Method Details

    • validate

      public Optional<Integer> validate(Integer integer)
      Description copied from interface: SimpleOption.Callbacks
      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<Integer>
      Returns:
      the validated value
      Mappings:
      Namespace Name Mixin selector
      official a Leqy$c;a(Ljava/lang/Integer;)Ljava/util/Optional;
      intermediary method_42408 Lnet/minecraft/class_7172$class_7304;method_42408(Ljava/lang/Integer;)Ljava/util/Optional;
      named validate Lnet/minecraft/client/option/SimpleOption$MaxSuppliableIntCallbacks;validate(Ljava/lang/Integer;)Ljava/util/Optional;
    • maxInclusive

      public int maxInclusive()
      Specified by:
      maxInclusive in interface SimpleOption.IntSliderCallbacks
      Mappings:
      Namespace Name Mixin selector
      official b Leqy$g;b()I
      intermediary comp_594 Lnet/minecraft/class_7172$class_7275;comp_594()I
      named maxInclusive Lnet/minecraft/client/option/SimpleOption$IntSliderCallbacks;maxInclusive()I
    • codec

      public com.mojang.serialization.Codec<Integer> codec()
      Specified by:
      codec in interface SimpleOption.Callbacks<Integer>
      Mappings:
      Namespace Name Mixin selector
      official f Leqy$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;
    • isCycling

      public boolean isCycling()
      Specified by:
      isCycling in interface SimpleOption.TypeChangeableCallbacks<Integer>
      Mappings:
      Namespace Name Mixin selector
      official c Leqy$j;c()Z
      intermediary method_42722 Lnet/minecraft/class_7172$class_7306;method_42722()Z
      named isCycling Lnet/minecraft/client/option/SimpleOption$TypeChangeableCallbacks;isCycling()Z
    • getValues

      public CyclingButtonWidget.Values<Integer> getValues()
      Specified by:
      getValues in interface SimpleOption.CyclingCallbacks<Integer>
      Mappings:
      Namespace Name Mixin selector
      official a Leqy$d;a()Lesx$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;
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • minInclusive

      public int minInclusive()
      Specified by:
      minInclusive in interface SimpleOption.IntSliderCallbacks
      Mappings:
      Namespace Name Mixin selector
      official d Leqy$g;d()I
      intermediary comp_593 Lnet/minecraft/class_7172$class_7275;comp_593()I
      named minInclusive Lnet/minecraft/client/option/SimpleOption$IntSliderCallbacks;minInclusive()I
    • maxSupplier

      public IntSupplier maxSupplier()
      Returns the value of the maxSupplier record component.
      Returns:
      the value of the maxSupplier record component
    • encodableMaxInclusive

      public int encodableMaxInclusive()
      Returns the value of the encodableMaxInclusive record component.
      Returns:
      the value of the encodableMaxInclusive record component