Record Class NumberRangeInput.RangeInfo

java.lang.Object
java.lang.Record
net.minecraft.server.dialog.input.NumberRangeInput.RangeInfo
Enclosing class:
NumberRangeInput

public static record NumberRangeInput.RangeInfo(float start, float end, Optional<Float> initial, Optional<Float> step) extends Record
  • Field Details

    • start

      private final float start
      The field for the start record component.
    • end

      private final float end
      The field for the end record component.
    • initial

      private final Optional<Float> initial
      The field for the initial record component.
    • step

      private final Optional<Float> step
      The field for the step record component.
    • MAP_CODEC

      public static final com.mojang.serialization.MapCodec<NumberRangeInput.RangeInfo> MAP_CODEC
  • Constructor Details

    • RangeInfo

      public RangeInfo(float start, float end, Optional<Float> initial, Optional<Float> step)
      Creates an instance of a RangeInfo record class.
      Parameters:
      start - the value for the start record component
      end - the value for the end record component
      initial - the value for the initial record component
      step - the value for the step record component
  • Method Details

    • computeScaledValue

      public float computeScaledValue(float p_427226_)
    • isOutOfRange

      private boolean isOutOfRange(float p_427366_)
    • initialScaledValue

      private float initialScaledValue()
    • initialSliderValue

      public float initialSliderValue()
    • scaledValueToSlider

      private float scaledValueToSlider(float p_427373_)
    • 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 o)
      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:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • start

      public float start()
      Returns the value of the start record component.
      Returns:
      the value of the start record component
    • end

      public float end()
      Returns the value of the end record component.
      Returns:
      the value of the end record component
    • initial

      public Optional<Float> initial()
      Returns the value of the initial record component.
      Returns:
      the value of the initial record component
    • step

      public Optional<Float> step()
      Returns the value of the step record component.
      Returns:
      the value of the step record component