Class BaseDialog<T extends BaseDialog<T>>

java.lang.Object
com.github.darksoulq.abyssallib.world.dialog.BaseDialog<T>
Type Parameters:
T - The type of the dialog implementation, used for method chaining.
Direct Known Subclasses:
Confirmation, DialogList, MultiAction, Notice, ServerLinks

public abstract class BaseDialog<T extends BaseDialog<T>> extends Object
An abstract base class providing a fluent builder-style API for creating Minecraft Dialogs. This class encapsulates the state required to construct Paper-based dialogs, including input elements, body content, and lifecycle actions.
  • Method Summary

    Modifier and Type
    Method
    Description
    after(io.papermc.paper.registry.data.dialog.DialogBase.DialogAfterAction afterAction)
    Sets the behavior of the dialog after an action is performed.
    body(io.papermc.paper.registry.data.dialog.body.DialogBody body)
    Adds a body element to the dialog collection.
    abstract io.papermc.paper.dialog.Dialog
    Constructs the final Dialog object from the configured state.
    closeWithEscape(boolean should)
    Sets whether the dialog should close when the Escape key is pressed.
    external(net.kyori.adventure.text.Component title)
    Sets an external title for the dialog.
    input(io.papermc.paper.registry.data.dialog.input.DialogInput input)
    Adds an input element to the dialog collection.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • after

      public T after(io.papermc.paper.registry.data.dialog.DialogBase.DialogAfterAction afterAction)
      Sets the behavior of the dialog after an action is performed.
      Parameters:
      afterAction - The DialogBase.DialogAfterAction to apply upon completion.
      Returns:
      This dialog instance cast to the implementation type T.
    • external

      public T external(net.kyori.adventure.text.Component title)
      Sets an external title for the dialog.
      Parameters:
      title - The Component to display as an external title header.
      Returns:
      This dialog instance cast to the implementation type T.
    • closeWithEscape

      public T closeWithEscape(boolean should)
      Sets whether the dialog should close when the Escape key is pressed.
      Parameters:
      should - True if escape should close the dialog, false otherwise.
      Returns:
      This dialog instance cast to the implementation type T.
    • input

      public T input(io.papermc.paper.registry.data.dialog.input.DialogInput input)
      Adds an input element to the dialog collection.
      Parameters:
      input - The DialogInput interactive element to append.
      Returns:
      This dialog instance cast to the implementation type T.
    • body

      public T body(io.papermc.paper.registry.data.dialog.body.DialogBody body)
      Adds a body element to the dialog collection.
      Parameters:
      body - The DialogBody content element to append.
      Returns:
      This dialog instance cast to the implementation type T.
    • build

      public abstract io.papermc.paper.dialog.Dialog build()
      Constructs the final Dialog object from the configured state.
      Returns:
      A built Dialog ready to be shown to a player via the API.