Interface DialogBase
@NonExtendable
public interface DialogBase
Represents the base of all dialogs.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilder interface for creating dialog bases.static enumActions to take after the dialog is closed. -
Method Summary
Modifier and TypeMethodDescriptionThe action to take after the dialog is closed.@Unmodifiable List<DialogBody> body()The body of the dialog.static DialogBase.Builderbuilder(net.kyori.adventure.text.Component title) Creates a new dialog base builder.booleanReturns if this dialog can be closed with the "escape" keybind.static DialogBasecreate(net.kyori.adventure.text.Component title, @Nullable net.kyori.adventure.text.Component externalTitle, boolean canCloseWithEscape, boolean pause, DialogBase.DialogAfterAction afterAction, List<? extends DialogBody> body, List<? extends DialogInput> inputs) Creates a new dialog base.@Nullable net.kyori.adventure.text.ComponentThe external title of the dialog.@Unmodifiable List<DialogInput> inputs()The inputs of the dialog.booleanpause()Returns if this dialog should pause the game when opened (single-player only).net.kyori.adventure.text.Componenttitle()The title of the dialog.
-
Method Details
-
create
@Contract(value="_, _, _, _, _, _, _ -> new", pure=true) static DialogBase create(net.kyori.adventure.text.Component title, @Nullable net.kyori.adventure.text.Component externalTitle, boolean canCloseWithEscape, boolean pause, DialogBase.DialogAfterAction afterAction, List<? extends DialogBody> body, List<? extends DialogInput> inputs) Creates a new dialog base.- Parameters:
title- the title of the dialogexternalTitle- the external title of the dialog, or null if not setcanCloseWithEscape- if the dialog can be closed with the "escape" keybindpause- if the dialog should pause the game when opened (single-player only)afterAction- the action to take after the dialog is closedbody- the body of the dialoginputs- the inputs of the dialog- Returns:
- a new dialog base instance
-
builder
@Contract(value="_ -> new", pure=true) static DialogBase.Builder builder(net.kyori.adventure.text.Component title) Creates a new dialog base builder.- Parameters:
title- the title of the dialog- Returns:
- a new dialog base builder
-
title
@Contract(pure=true) net.kyori.adventure.text.Component title()The title of the dialog.- Returns:
- the title
-
externalTitle
The external title of the dialog. This title is used on buttons that open this dialog.- Returns:
- the external title or null
-
canCloseWithEscape
@Contract(pure=true) boolean canCloseWithEscape()Returns if this dialog can be closed with the "escape" keybind.- Returns:
- if the dialog can be closed with "escape"
-
pause
@Contract(pure=true) boolean pause()Returns if this dialog should pause the game when opened (single-player only).- Returns:
- if the dialog pauses the game
-
afterAction
The action to take after the dialog is closed.- Returns:
- the action to take after the dialog is closed
-
body
The body of the dialog.The body is a list of
DialogBodyelements that will be displayed in the dialog.- Returns:
- the body of the dialog
-
inputs
The inputs of the dialog.The inputs are a list of
DialogInputelements that will be displayed in the dialog.- Returns:
- the inputs of the dialog
-