Class PEDialog<T extends PEDialog<T>>
java.lang.Object
io.github.projectunified.unidialog.packetevents.dialog.PEDialog<T>
- All Implemented Interfaces:
AdventureDialog<com.github.retrooper.packetevents.protocol.item.ItemStack,
,PEDialogBodyBuilder, PEDialogInputBuilder, T> AdventureSupport
,Dialog<com.github.retrooper.packetevents.protocol.item.ItemStack,
PEDialogBodyBuilder, PEDialogInputBuilder, T>
- Direct Known Subclasses:
PEConfirmationDialog
,PEDialogListDialog
,PEMultiActionDialog
,PENoticeDialog
,PEServerLinksDialog
public abstract class PEDialog<T extends PEDialog<T>>
extends Object
implements AdventureDialog<com.github.retrooper.packetevents.protocol.item.ItemStack,PEDialogBodyBuilder,PEDialogInputBuilder,T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.projectunified.unidialog.core.dialog.Dialog
Dialog.AfterAction
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionafterAction
(Dialog.AfterAction afterAction) Set the action to be performed after an action is taken in the dialogbody
(Consumer<PEDialogBodyBuilder> bodyBuilder) Set the body of the dialogcanCloseWithEscape
(boolean canCloseWithEscape) Set the option to allow the dialog to be closed with the escape keyprotected abstract com.github.retrooper.packetevents.protocol.dialog.Dialog
constructDialog
(com.github.retrooper.packetevents.protocol.dialog.CommonDialogData commonDialogData) externalTitle
(@Nullable net.kyori.adventure.text.Component externalTitle) Set the external title of the dialog, which is used for displaying the dialog in a multi-dialog dialogprotected com.github.retrooper.packetevents.protocol.dialog.button.ActionButton
getAction
(Consumer<PEDialogActionBuilder> action) Get the deserializer function that converts a string to aComponent
final com.github.retrooper.packetevents.protocol.dialog.Dialog
input
(String key, Consumer<PEDialogInputBuilder> inputBuilder) Set the input for the dialogopener()
Create an opener for the dialogpause
(boolean pause) Set the option to pause the game while the dialog is opentitle
(net.kyori.adventure.text.Component title) Set the title of the dialogMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.projectunified.unidialog.adventure.dialog.AdventureDialog
externalTitle, title
Methods inherited from interface io.github.projectunified.unidialog.adventure.support.AdventureSupport
deserialize
-
Constructor Details
-
PEDialog
-
-
Method Details
-
getComponentDeserializer
Description copied from interface:AdventureSupport
Get the deserializer function that converts a string to aComponent
- Specified by:
getComponentDeserializer
in interfaceAdventureSupport
- Returns:
- the function that deserializes a string into a Component
-
title
Description copied from interface:AdventureDialog
Set the title of the dialog- Specified by:
title
in interfaceAdventureDialog<com.github.retrooper.packetevents.protocol.item.ItemStack,
PEDialogBodyBuilder, PEDialogInputBuilder, T extends PEDialog<T>> - Parameters:
title
- the title of the dialog- Returns:
- the dialog itself for method chaining
-
externalTitle
Description copied from interface:AdventureDialog
Set the external title of the dialog, which is used for displaying the dialog in a multi-dialog dialog- Specified by:
externalTitle
in interfaceAdventureDialog<com.github.retrooper.packetevents.protocol.item.ItemStack,
PEDialogBodyBuilder, PEDialogInputBuilder, T extends PEDialog<T>> - Parameters:
externalTitle
- the external title of the dialog- Returns:
- the dialog itself for method chaining
-
canCloseWithEscape
Description copied from interface:Dialog
Set the option to allow the dialog to be closed with the escape key- Specified by:
canCloseWithEscape
in interfaceDialog<com.github.retrooper.packetevents.protocol.item.ItemStack,
PEDialogBodyBuilder, PEDialogInputBuilder, T extends PEDialog<T>> - Parameters:
canCloseWithEscape
- whether the dialog can be closed with the escape key- Returns:
- the dialog itself for method chaining
-
pause
Description copied from interface:Dialog
Set the option to pause the game while the dialog is open- Specified by:
pause
in interfaceDialog<com.github.retrooper.packetevents.protocol.item.ItemStack,
PEDialogBodyBuilder, PEDialogInputBuilder, T extends PEDialog<T>> - Parameters:
pause
- whether the dialog should pause the game- Returns:
- the dialog itself for method chaining
-
afterAction
Description copied from interface:Dialog
Set the action to be performed after an action is taken in the dialog- Specified by:
afterAction
in interfaceDialog<com.github.retrooper.packetevents.protocol.item.ItemStack,
PEDialogBodyBuilder, PEDialogInputBuilder, T extends PEDialog<T>> - Parameters:
afterAction
- the action to be performed after an action is taken- Returns:
- the dialog itself for method chaining
-
body
Description copied from interface:Dialog
Set the body of the dialog- Specified by:
body
in interfaceDialog<com.github.retrooper.packetevents.protocol.item.ItemStack,
PEDialogBodyBuilder, PEDialogInputBuilder, T extends PEDialog<T>> - Parameters:
bodyBuilder
- the body builder for the dialog- Returns:
- the dialog itself for method chaining
-
input
Description copied from interface:Dialog
Set the input for the dialog- Specified by:
input
in interfaceDialog<com.github.retrooper.packetevents.protocol.item.ItemStack,
PEDialogBodyBuilder, PEDialogInputBuilder, T extends PEDialog<T>> - Parameters:
key
- the key for the inputinputBuilder
- the input builder for the dialog- Returns:
- the dialog itself for method chaining
-
getAction
protected com.github.retrooper.packetevents.protocol.dialog.button.ActionButton getAction(Consumer<PEDialogActionBuilder> action) -
constructDialog
protected abstract com.github.retrooper.packetevents.protocol.dialog.Dialog constructDialog(com.github.retrooper.packetevents.protocol.dialog.CommonDialogData commonDialogData) -
getDialog
public final com.github.retrooper.packetevents.protocol.dialog.Dialog getDialog() -
opener
Description copied from interface:Dialog
Create an opener for the dialog- Specified by:
opener
in interfaceDialog<com.github.retrooper.packetevents.protocol.item.ItemStack,
PEDialogBodyBuilder, PEDialogInputBuilder, T extends PEDialog<T>> - Returns:
- the dialog opener
-