Interface DialogManager<I,BB extends DialogBodyBuilder<I>,IB extends DialogInputBuilder,D extends Dialog<I,BB,IB,?>,AB extends DialogActionBuilder<D,AB>>
- Type Parameters:
I
- the type of the item for the item bodyBB
- the type of the dialog body builderIB
- the type of the dialog input builderD
- the type of the base dialogAB
- the type of the dialog action builder
- All Known Implementing Classes:
PaperDialogManager
,PocketEventsDialogManager
,SpigotDialogManager
public interface DialogManager<I,BB extends DialogBodyBuilder<I>,IB extends DialogInputBuilder,D extends Dialog<I,BB,IB,?>,AB extends DialogActionBuilder<D,AB>>
The main interface for managing dialogs in the UniDialog framework.
It provides methods to create different types of dialogs, register and unregister custom actions,
and manage dialog instances.
This interface is generic and can be used with various types of dialog builders and input builders.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
clearDialog
(UUID uuid) Clear the current dialog associated with the given player UUID.Create a confirmation dialogCreate a dialog list dialogCreate a multi-action dialogCreate a notice dialogCreate a server links dialogvoid
register()
Register the dialog managervoid
registerCustomAction
(String namespace, String id, BiConsumer<UUID, Map<String, String>> action) Register a custom action with a namespace and a unique identifier.void
registerCustomAction
(String id, BiConsumer<UUID, Map<String, String>> action) Register a custom action with a unique identifier.void
Unregister the dialog managervoid
Unregister all custom actions.void
Unregister a custom action by its unique identifier.void
unregisterCustomAction
(String namespace, String id) Unregister a custom action by its namespace and unique identifier.
-
Method Details
-
createConfirmationDialog
Create a confirmation dialog- Type Parameters:
T
- the type of the confirmation dialog, extending ConfirmationDialog- Returns:
- a new instance of ConfirmationDialog
-
createMultiActionDialog
Create a multi-action dialog- Type Parameters:
T
- the type of the multi-action dialog, extending MultiActionDialog- Returns:
- a new instance of MultiActionDialog
-
createServerLinksDialog
Create a server links dialog- Type Parameters:
T
- the type of the server links dialog, extending ServerLinksDialog- Returns:
- a new instance of ServerLinksDialog
-
createNoticeDialog
Create a notice dialog- Type Parameters:
T
- the type of the notice dialog, extending NoticeDialog- Returns:
- a new instance of NoticeDialog
-
createDialogListDialog
Create a dialog list dialog- Type Parameters:
T
- the type of the dialog list dialog, extending DialogListDialog- Returns:
- a new instance of DialogListDialog
-
register
void register()Register the dialog manager -
unregister
void unregister()Unregister the dialog manager -
registerCustomAction
Register a custom action with a unique identifier.- Parameters:
id
- the unique identifier for the custom actionaction
- the action to be executed, taking a UUID and a map of parameters
-
registerCustomAction
Register a custom action with a namespace and a unique identifier.- Parameters:
namespace
- the namespace for the custom actionid
- the unique identifier for the custom actionaction
- the action to be executed, taking a UUID and a map of parameters
-
unregisterCustomAction
Unregister a custom action by its unique identifier.- Parameters:
id
- the unique identifier of the custom action to be unregistered
-
unregisterCustomAction
Unregister a custom action by its namespace and unique identifier.- Parameters:
namespace
- the namespace of the custom actionid
- the unique identifier of the custom action to be unregistered
-
unregisterAllCustomActions
void unregisterAllCustomActions()Unregister all custom actions. -
clearDialog
Clear the current dialog associated with the given player UUID.- Parameters:
uuid
- the unique identifier of the player whose dialog should be cleared- Returns:
- true if the dialog was successfully cleared, false otherwise
-