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 Details

    • title

      private final Component title
      The field for the title record component.
    • externalTitle

      private final Optional<Component> externalTitle
      The field for the externalTitle record component.
    • canCloseWithEscape

      private final boolean canCloseWithEscape
      The field for the canCloseWithEscape record component.
    • pause

      private final boolean pause
      The field for the pause record component.
    • afterAction

      private final DialogAction afterAction
      The field for the afterAction record component.
    • body

      private final List<DialogBody> body
      The field for the body record component.
    • inputs

      private final List<Input> inputs
      The field for the inputs record component.
    • MAP_CODEC

      public static final com.mojang.serialization.MapCodec<CommonDialogData> 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 a CommonDialogData record class.
      Parameters:
      title - the value for the title record component
      externalTitle - the value for the externalTitle record component
      canCloseWithEscape - the value for the canCloseWithEscape record component
      pause - the value for the pause record component
      afterAction - the value for the afterAction record component
      body - the value for the body record component
      inputs - the value for the inputs record component
  • Method Details

    • computeExternalTitle

      public Component computeExternalTitle()
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • title

      public Component title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • externalTitle

      public Optional<Component> externalTitle()
      Returns the value of the externalTitle record component.
      Returns:
      the value of the externalTitle record component
    • canCloseWithEscape

      public boolean canCloseWithEscape()
      Returns the value of the canCloseWithEscape record component.
      Returns:
      the value of the canCloseWithEscape record component
    • pause

      public boolean pause()
      Returns the value of the pause record component.
      Returns:
      the value of the pause record component
    • afterAction

      public DialogAction afterAction()
      Returns the value of the afterAction record component.
      Returns:
      the value of the afterAction record component
    • body

      public List<DialogBody> body()
      Returns the value of the body record component.
      Returns:
      the value of the body record component
    • inputs

      public List<Input> inputs()
      Returns the value of the inputs record component.
      Returns:
      the value of the inputs record component