Package net.minecraft.server.dialog
Record Class CommonDialogData
java.lang.Object
java.lang.Record
net.minecraft.server.dialog.CommonDialogData
public record CommonDialogData(Component title, Optional<Component> externalTitle, boolean canCloseWithEscape, boolean pause, DialogAction afterAction, List<DialogBody> body, List<Input> inputs)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DialogAction
The field for theafterAction
record component.private final List
<DialogBody> The field for thebody
record component.private final boolean
The field for thecanCloseWithEscape
record component.The field for theexternalTitle
record component.The field for theinputs
record component.static final com.mojang.serialization.MapCodec
<CommonDialogData> private final boolean
The field for thepause
record component.private final Component
The field for thetitle
record component. -
Constructor Summary
ConstructorsConstructorDescriptionCommonDialogData
(Component title, Optional<Component> externalTitle, boolean canCloseWithEscape, boolean pause, DialogAction afterAction, List<DialogBody> body, List<Input> inputs) Creates an instance of aCommonDialogData
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theafterAction
record component.body()
Returns the value of thebody
record component.boolean
Returns the value of thecanCloseWithEscape
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of theexternalTitle
record component.final int
hashCode()
Returns a hash code value for this object.inputs()
Returns the value of theinputs
record component.boolean
pause()
Returns the value of thepause
record component.title()
Returns the value of thetitle
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
title
The field for thetitle
record component. -
externalTitle
The field for theexternalTitle
record component. -
canCloseWithEscape
private final boolean canCloseWithEscapeThe field for thecanCloseWithEscape
record component. -
pause
private final boolean pauseThe field for thepause
record component. -
afterAction
The field for theafterAction
record component. -
body
The field for thebody
record component. -
inputs
The field for theinputs
record component. -
MAP_CODEC
-
-
Constructor Details
-
CommonDialogData
public CommonDialogData(Component title, Optional<Component> externalTitle, boolean canCloseWithEscape, boolean pause, DialogAction afterAction, List<DialogBody> body, List<Input> inputs) Creates an instance of aCommonDialogData
record class.- Parameters:
title
- the value for thetitle
record componentexternalTitle
- the value for theexternalTitle
record componentcanCloseWithEscape
- the value for thecanCloseWithEscape
record componentpause
- the value for thepause
record componentafterAction
- the value for theafterAction
record componentbody
- the value for thebody
record componentinputs
- the value for theinputs
record component
-
-
Method Details
-
computeExternalTitle
-
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 '=='. -
title
Returns the value of thetitle
record component.- Returns:
- the value of the
title
record component
-
externalTitle
Returns the value of theexternalTitle
record component.- Returns:
- the value of the
externalTitle
record component
-
canCloseWithEscape
public boolean canCloseWithEscape()Returns the value of thecanCloseWithEscape
record component.- Returns:
- the value of the
canCloseWithEscape
record component
-
pause
public boolean pause()Returns the value of thepause
record component.- Returns:
- the value of the
pause
record component
-
afterAction
Returns the value of theafterAction
record component.- Returns:
- the value of the
afterAction
record component
-
body
Returns the value of thebody
record component.- Returns:
- the value of the
body
record component
-
inputs
Returns the value of theinputs
record component.- Returns:
- the value of the
inputs
record component
-