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 boolean
The field for theinitial
record component.private final Component
The field for thelabel
record component.static final com.mojang.serialization.MapCodec
<BooleanInput> private final String
The field for theonFalse
record component.private final String
The field for theonTrue
record component. -
Constructor Summary
ConstructorsConstructorDescriptionBooleanInput
(Component label, boolean initial, String onTrue, String onFalse) Creates an instance of aBooleanInput
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
initial()
Returns the value of theinitial
record component.label()
Returns the value of thelabel
record component.com.mojang.serialization.MapCodec
<BooleanInput> mapCodec()
onFalse()
Returns the value of theonFalse
record component.onTrue()
Returns the value of theonTrue
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
label
The field for thelabel
record component. -
initial
private final boolean initialThe field for theinitial
record component. -
onTrue
The field for theonTrue
record component. -
onFalse
The field for theonFalse
record component. -
MAP_CODEC
-
-
Constructor Details
-
BooleanInput
Creates an instance of aBooleanInput
record class.- Parameters:
label
- the value for thelabel
record componentinitial
- the value for theinitial
record componentonTrue
- the value for theonTrue
record componentonFalse
- the value for theonFalse
record component
-
-
Method Details
-
mapCodec
- Specified by:
mapCodec
in 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 thelabel
record component.- Returns:
- the value of the
label
record component
-
initial
public boolean initial()Returns the value of theinitial
record component.- Returns:
- the value of the
initial
record component
-
onTrue
Returns the value of theonTrue
record component.- Returns:
- the value of the
onTrue
record component
-
onFalse
Returns the value of theonFalse
record component.- Returns:
- the value of the
onFalse
record component
-