Record Class NumberRangeInput.RangeInfo
java.lang.Object
java.lang.Record
net.minecraft.server.dialog.input.NumberRangeInput.RangeInfo
- Enclosing class:
NumberRangeInput
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final float
The field for theend
record component.The field for theinitial
record component.static final com.mojang.serialization.MapCodec
<NumberRangeInput.RangeInfo> private final float
The field for thestart
record component.The field for thestep
record component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
computeScaledValue
(float p_427226_) float
end()
Returns the value of theend
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.initial()
Returns the value of theinitial
record component.private float
float
private boolean
isOutOfRange
(float p_427366_) private float
scaledValueToSlider
(float p_427373_) float
start()
Returns the value of thestart
record component.step()
Returns the value of thestep
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
start
private final float startThe field for thestart
record component. -
end
private final float endThe field for theend
record component. -
initial
The field for theinitial
record component. -
step
The field for thestep
record component. -
MAP_CODEC
-
-
Constructor Details
-
RangeInfo
Creates an instance of aRangeInfo
record class.- Parameters:
start
- the value for thestart
record componentend
- the value for theend
record componentinitial
- the value for theinitial
record componentstep
- the value for thestep
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
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. -
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. -
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
start
public float start()Returns the value of thestart
record component.- Returns:
- the value of the
start
record component
-
end
public float end()Returns the value of theend
record component.- Returns:
- the value of the
end
record component
-
initial
Returns the value of theinitial
record component.- Returns:
- the value of the
initial
record component
-
step
Returns the value of thestep
record component.- Returns:
- the value of the
step
record component
-