Package net.minecraft.server.dialog
Record Class ConfirmationDialog
java.lang.Object
java.lang.Record
net.minecraft.server.dialog.ConfirmationDialog
- All Implemented Interfaces:
Dialog
,SimpleDialog
public record ConfirmationDialog(CommonDialogData common, ActionButton yesButton, ActionButton noButton)
extends Record
implements SimpleDialog
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CommonDialogData
The field for thecommon
record component.static final com.mojang.serialization.MapCodec
<ConfirmationDialog> private final ActionButton
The field for thenoButton
record component.private final ActionButton
The field for theyesButton
record component.Fields inherited from interface net.minecraft.server.dialog.Dialog
CODEC, CONTEXT_FREE_STREAM_CODEC, DIRECT_CODEC, LIST_CODEC, STREAM_CODEC, WIDTH_CODEC
-
Constructor Summary
ConstructorsConstructorDescriptionConfirmationDialog
(CommonDialogData common, ActionButton yesButton, ActionButton noButton) Creates an instance of aConfirmationDialog
record class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec
<ConfirmationDialog> codec()
common()
Returns the value of thecommon
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.noButton()
Returns the value of thenoButton
record component.onCancel()
final String
toString()
Returns a string representation of this record class.Returns the value of theyesButton
record component.
-
Field Details
-
common
The field for thecommon
record component. -
yesButton
The field for theyesButton
record component. -
noButton
The field for thenoButton
record component. -
MAP_CODEC
-
-
Constructor Details
-
ConfirmationDialog
Creates an instance of aConfirmationDialog
record class.- Parameters:
common
- the value for thecommon
record componentyesButton
- the value for theyesButton
record componentnoButton
- the value for thenoButton
record component
-
-
Method Details
-
codec
- Specified by:
codec
in interfaceDialog
- Specified by:
codec
in interfaceSimpleDialog
-
onCancel
-
mainActions
- Specified by:
mainActions
in interfaceSimpleDialog
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
common
Returns the value of thecommon
record component. -
yesButton
Returns the value of theyesButton
record component.- Returns:
- the value of the
yesButton
record component
-
noButton
Returns the value of thenoButton
record component.- Returns:
- the value of the
noButton
record component
-