Record Class NumberRangeInput
java.lang.Object
java.lang.Record
net.minecraft.server.dialog.input.NumberRangeInput
- All Implemented Interfaces:
InputControl
public record NumberRangeInput(int width, Component label, String labelFormat, NumberRangeInput.RangeInfo rangeInfo)
extends Record
implements InputControl
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ComponentThe field for thelabelrecord component.private final StringThe field for thelabelFormatrecord component.static final com.mojang.serialization.MapCodec<NumberRangeInput> private final NumberRangeInput.RangeInfoThe field for therangeInforecord component.private final intThe field for thewidthrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionNumberRangeInput(int width, Component label, String labelFormat, NumberRangeInput.RangeInfo rangeInfo) Creates an instance of aNumberRangeInputrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncomputeLabel(String p_426283_) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.label()Returns the value of thelabelrecord component.Returns the value of thelabelFormatrecord component.com.mojang.serialization.MapCodec<NumberRangeInput> mapCodec()Returns the value of therangeInforecord component.final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
-
Field Details
-
width
private final int widthThe field for thewidthrecord component. -
label
The field for thelabelrecord component. -
labelFormat
The field for thelabelFormatrecord component. -
rangeInfo
The field for therangeInforecord component. -
MAP_CODEC
-
-
Constructor Details
-
NumberRangeInput
public NumberRangeInput(int width, Component label, String labelFormat, NumberRangeInput.RangeInfo rangeInfo) Creates an instance of aNumberRangeInputrecord class.- Parameters:
width- the value for thewidthrecord componentlabel- the value for thelabelrecord componentlabelFormat- the value for thelabelFormatrecord componentrangeInfo- the value for therangeInforecord component
-
-
Method Details
-
mapCodec
- Specified by:
mapCodecin interfaceInputControl
-
computeLabel
-
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 '=='. -
width
public int width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
labelFormat
Returns the value of thelabelFormatrecord component.- Returns:
- the value of the
labelFormatrecord component
-
rangeInfo
Returns the value of therangeInforecord component.- Returns:
- the value of the
rangeInforecord component
-