Record Class BooleanInput
java.lang.Object
java.lang.Record
net.minecraft.server.dialog.input.BooleanInput
- All Implemented Interfaces:
InputControl
public record BooleanInput(Component label, boolean initial, String onTrue, String onFalse)
extends Record
implements InputControl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for theinitialrecord component.private final ComponentThe field for thelabelrecord component.static final com.mojang.serialization.MapCodec<BooleanInput> private final StringThe field for theonFalserecord component.private final StringThe field for theonTruerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionBooleanInput(Component label, boolean initial, String onTrue, String onFalse) Creates an instance of aBooleanInputrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleaninitial()Returns the value of theinitialrecord component.label()Returns the value of thelabelrecord component.com.mojang.serialization.MapCodec<BooleanInput> mapCodec()onFalse()Returns the value of theonFalserecord component.onTrue()Returns the value of theonTruerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
label
The field for thelabelrecord component. -
initial
private final boolean initialThe field for theinitialrecord component. -
onTrue
The field for theonTruerecord component. -
onFalse
The field for theonFalserecord component. -
MAP_CODEC
-
-
Constructor Details
-
BooleanInput
Creates an instance of aBooleanInputrecord class.- Parameters:
label- the value for thelabelrecord componentinitial- the value for theinitialrecord componentonTrue- the value for theonTruerecord componentonFalse- the value for theonFalserecord component
-
-
Method Details
-
mapCodec
- Specified by:
mapCodecin interfaceInputControl
-
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 '=='. -
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
initial
public boolean initial()Returns the value of theinitialrecord component.- Returns:
- the value of the
initialrecord component
-
onTrue
Returns the value of theonTruerecord component.- Returns:
- the value of the
onTruerecord component
-
onFalse
Returns the value of theonFalserecord component.- Returns:
- the value of the
onFalserecord component
-