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 CommonDialogDataThe field for thecommonrecord component.static final com.mojang.serialization.MapCodec<ConfirmationDialog> private final ActionButtonThe field for thenoButtonrecord component.private final ActionButtonThe field for theyesButtonrecord 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 aConfirmationDialogrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<ConfirmationDialog> codec()common()Returns the value of thecommonrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.noButton()Returns the value of thenoButtonrecord component.onCancel()final StringtoString()Returns a string representation of this record class.Returns the value of theyesButtonrecord component.
-
Field Details
-
common
The field for thecommonrecord component. -
yesButton
The field for theyesButtonrecord component. -
noButton
The field for thenoButtonrecord component. -
MAP_CODEC
-
-
Constructor Details
-
ConfirmationDialog
Creates an instance of aConfirmationDialogrecord class.- Parameters:
common- the value for thecommonrecord componentyesButton- the value for theyesButtonrecord componentnoButton- the value for thenoButtonrecord component
-
-
Method Details
-
codec
- Specified by:
codecin interfaceDialog- Specified by:
codecin interfaceSimpleDialog
-
onCancel
-
mainActions
- Specified by:
mainActionsin 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 thecommonrecord component. -
yesButton
Returns the value of theyesButtonrecord component.- Returns:
- the value of the
yesButtonrecord component
-
noButton
Returns the value of thenoButtonrecord component.- Returns:
- the value of the
noButtonrecord component
-