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
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 TypeMethodDescriptionafter(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.Dialogbuild()Constructs the finalDialogobject 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.
-
Method Details
-
after
Sets the behavior of the dialog after an action is performed.- Parameters:
afterAction- TheDialogBase.DialogAfterActionto apply upon completion.- Returns:
- This dialog instance cast to the implementation type
T.
-
external
Sets an external title for the dialog.- Parameters:
title- TheComponentto display as an external title header.- Returns:
- This dialog instance cast to the implementation type
T.
-
closeWithEscape
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
Adds an input element to the dialog collection.- Parameters:
input- TheDialogInputinteractive element to append.- Returns:
- This dialog instance cast to the implementation type
T.
-
body
Adds a body element to the dialog collection.- Parameters:
body- TheDialogBodycontent element to append.- Returns:
- This dialog instance cast to the implementation type
T.
-
build
public abstract io.papermc.paper.dialog.Dialog build()Constructs the finalDialogobject from the configured state.- Returns:
- A built Dialog ready to be shown to a player via the API.
-