Class SpigotDialogManager
java.lang.Object
io.github.projectunified.unidialog.spigot.SpigotDialogManager
- All Implemented Interfaces:
DialogManager<org.bukkit.inventory.ItemStack,
,SpigotDialogBodyBuilder, SpigotDialogInputBuilder, SpigotDialog<?>, SpigotDialogActionBuilder> org.bukkit.event.Listener
public class SpigotDialogManager
extends Object
implements DialogManager<org.bukkit.inventory.ItemStack,SpigotDialogBodyBuilder,SpigotDialogInputBuilder,SpigotDialog<?>,SpigotDialogActionBuilder>, org.bukkit.event.Listener
-
Constructor Summary
ConstructorsConstructorDescriptionSpigotDialogManager
(org.bukkit.plugin.Plugin plugin) SpigotDialogManager
(org.bukkit.plugin.Plugin plugin, String defaultNamespace) -
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
onCustomClick
(org.bukkit.event.player.PlayerCustomClickEvent event) void
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.
-
Constructor Details
-
SpigotDialogManager
-
SpigotDialogManager
public SpigotDialogManager(org.bukkit.plugin.Plugin plugin)
-
-
Method Details
-
createConfirmationDialog
Description copied from interface:DialogManager
Create a confirmation dialog- Specified by:
createConfirmationDialog
in interfaceDialogManager<org.bukkit.inventory.ItemStack,
SpigotDialogBodyBuilder, SpigotDialogInputBuilder, SpigotDialog<?>, SpigotDialogActionBuilder> - Returns:
- a new instance of ConfirmationDialog
-
createMultiActionDialog
Description copied from interface:DialogManager
Create a multi-action dialog- Specified by:
createMultiActionDialog
in interfaceDialogManager<org.bukkit.inventory.ItemStack,
SpigotDialogBodyBuilder, SpigotDialogInputBuilder, SpigotDialog<?>, SpigotDialogActionBuilder> - Returns:
- a new instance of MultiActionDialog
-
createServerLinksDialog
Description copied from interface:DialogManager
Create a server links dialog- Specified by:
createServerLinksDialog
in interfaceDialogManager<org.bukkit.inventory.ItemStack,
SpigotDialogBodyBuilder, SpigotDialogInputBuilder, SpigotDialog<?>, SpigotDialogActionBuilder> - Returns:
- a new instance of ServerLinksDialog
-
createNoticeDialog
Description copied from interface:DialogManager
Create a notice dialog- Specified by:
createNoticeDialog
in interfaceDialogManager<org.bukkit.inventory.ItemStack,
SpigotDialogBodyBuilder, SpigotDialogInputBuilder, SpigotDialog<?>, SpigotDialogActionBuilder> - Returns:
- a new instance of NoticeDialog
-
createDialogListDialog
Description copied from interface:DialogManager
Create a dialog list dialog- Specified by:
createDialogListDialog
in interfaceDialogManager<org.bukkit.inventory.ItemStack,
SpigotDialogBodyBuilder, SpigotDialogInputBuilder, SpigotDialog<?>, SpigotDialogActionBuilder> - Returns:
- a new instance of DialogListDialog
-
register
public void register()Description copied from interface:DialogManager
Register the dialog manager- Specified by:
register
in interfaceDialogManager<org.bukkit.inventory.ItemStack,
SpigotDialogBodyBuilder, SpigotDialogInputBuilder, SpigotDialog<?>, SpigotDialogActionBuilder>
-
unregister
public void unregister()Description copied from interface:DialogManager
Unregister the dialog manager- Specified by:
unregister
in interfaceDialogManager<org.bukkit.inventory.ItemStack,
SpigotDialogBodyBuilder, SpigotDialogInputBuilder, SpigotDialog<?>, SpigotDialogActionBuilder>
-
onCustomClick
public void onCustomClick(org.bukkit.event.player.PlayerCustomClickEvent event) -
registerCustomAction
Description copied from interface:DialogManager
Register a custom action with a unique identifier.- Specified by:
registerCustomAction
in interfaceDialogManager<org.bukkit.inventory.ItemStack,
SpigotDialogBodyBuilder, SpigotDialogInputBuilder, SpigotDialog<?>, SpigotDialogActionBuilder> - Parameters:
id
- the unique identifier for the custom actionaction
- the action to be executed, taking a UUID and a map of parameters
-
registerCustomAction
public void registerCustomAction(String namespace, String id, BiConsumer<UUID, Map<String, String>> action) Description copied from interface:DialogManager
Register a custom action with a namespace and a unique identifier.- Specified by:
registerCustomAction
in interfaceDialogManager<org.bukkit.inventory.ItemStack,
SpigotDialogBodyBuilder, SpigotDialogInputBuilder, SpigotDialog<?>, SpigotDialogActionBuilder> - 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
Description copied from interface:DialogManager
Unregister a custom action by its unique identifier.- Specified by:
unregisterCustomAction
in interfaceDialogManager<org.bukkit.inventory.ItemStack,
SpigotDialogBodyBuilder, SpigotDialogInputBuilder, SpigotDialog<?>, SpigotDialogActionBuilder> - Parameters:
id
- the unique identifier of the custom action to be unregistered
-
unregisterCustomAction
Description copied from interface:DialogManager
Unregister a custom action by its namespace and unique identifier.- Specified by:
unregisterCustomAction
in interfaceDialogManager<org.bukkit.inventory.ItemStack,
SpigotDialogBodyBuilder, SpigotDialogInputBuilder, SpigotDialog<?>, SpigotDialogActionBuilder> - Parameters:
namespace
- the namespace of the custom actionid
- the unique identifier of the custom action to be unregistered
-
unregisterAllCustomActions
public void unregisterAllCustomActions()Description copied from interface:DialogManager
Unregister all custom actions.- Specified by:
unregisterAllCustomActions
in interfaceDialogManager<org.bukkit.inventory.ItemStack,
SpigotDialogBodyBuilder, SpigotDialogInputBuilder, SpigotDialog<?>, SpigotDialogActionBuilder>
-
clearDialog
Description copied from interface:DialogManager
Clear the current dialog associated with the given player UUID.- Specified by:
clearDialog
in interfaceDialogManager<org.bukkit.inventory.ItemStack,
SpigotDialogBodyBuilder, SpigotDialogInputBuilder, SpigotDialog<?>, SpigotDialogActionBuilder> - Parameters:
uuid
- the unique identifier of the player whose dialog should be cleared- Returns:
- true if the dialog was successfully cleared, false otherwise
-