Class PaperDialog<T extends PaperDialog<T>>

java.lang.Object
io.github.projectunified.unidialog.paper.dialog.PaperDialog<T>
All Implemented Interfaces:
io.github.projectunified.unidialog.adventure.dialog.AdventureDialog<org.bukkit.inventory.ItemStack,PaperDialogBodyBuilder,PaperDialogInputBuilder,T>, io.github.projectunified.unidialog.adventure.support.AdventureSupport, io.github.projectunified.unidialog.core.dialog.Dialog<org.bukkit.inventory.ItemStack,PaperDialogBodyBuilder,PaperDialogInputBuilder,T>
Direct Known Subclasses:
PaperConfirmationDialog, PaperDialogListDialog, PaperMultiActionDialog, PaperNoticeDialog, PaperServerLinksDialog

public abstract class PaperDialog<T extends PaperDialog<T>> extends Object implements io.github.projectunified.unidialog.adventure.dialog.AdventureDialog<org.bukkit.inventory.ItemStack,PaperDialogBodyBuilder,PaperDialogInputBuilder,T>
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.github.projectunified.unidialog.core.dialog.Dialog

    io.github.projectunified.unidialog.core.dialog.Dialog.AfterAction
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    PaperDialog(String defaultNamespace, Function<String,net.kyori.adventure.text.Component> componentDeserializer)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    afterAction(io.github.projectunified.unidialog.core.dialog.Dialog.AfterAction afterAction)
     
     
    canCloseWithEscape(boolean canCloseWithEscape)
     
    externalTitle(@Nullable net.kyori.adventure.text.Component externalTitle)
     
    protected io.papermc.paper.registry.data.dialog.ActionButton
     
    Function<String,net.kyori.adventure.text.Component>
     
    final io.papermc.paper.dialog.Dialog
    Create a dialog using the provided factory
    final Consumer<io.papermc.paper.registry.data.dialog.DialogRegistryEntry.Builder>
    Get the dialog builder consumer that can be used to create a dialog
    protected abstract io.papermc.paper.registry.data.dialog.type.DialogType
     
     
     
    pause(boolean pause)
     
    final void
    register(String dialogId, io.papermc.paper.registry.event.RegistryComposeEvent<io.papermc.paper.dialog.Dialog,io.papermc.paper.registry.data.dialog.DialogRegistryEntry.Builder> event)
    Register the dialog with the default namespace and the provided dialog ID using the given event.
    final void
    register(String dialogId, io.papermc.paper.registry.event.WritableRegistry<io.papermc.paper.dialog.Dialog,io.papermc.paper.registry.data.dialog.DialogRegistryEntry.Builder> registry)
    Register the dialog with the default namespace and the provided dialog ID in the given registry.
    final void
    register(String namespace, String dialogId, io.papermc.paper.registry.event.RegistryComposeEvent<io.papermc.paper.dialog.Dialog,io.papermc.paper.registry.data.dialog.DialogRegistryEntry.Builder> event)
    Register the dialog with the default namespace and the provided dialog ID using the given event.
    final void
    register(String namespace, String dialogId, io.papermc.paper.registry.event.WritableRegistry<io.papermc.paper.dialog.Dialog,io.papermc.paper.registry.data.dialog.DialogRegistryEntry.Builder> registry)
    Register the dialog with the default namespace and the provided dialog ID in the given registry.
    final void
    register(net.kyori.adventure.key.Key key, io.papermc.paper.registry.event.RegistryComposeEvent<io.papermc.paper.dialog.Dialog,io.papermc.paper.registry.data.dialog.DialogRegistryEntry.Builder> event)
    Register the dialog with the provided key using the given event.
    final void
    register(net.kyori.adventure.key.Key key, io.papermc.paper.registry.event.WritableRegistry<io.papermc.paper.dialog.Dialog,io.papermc.paper.registry.data.dialog.DialogRegistryEntry.Builder> registry)
    Register the dialog with the provided key in the given registry.
    title(net.kyori.adventure.text.Component title)
     

    Methods 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

    Methods inherited from interface io.github.projectunified.unidialog.core.dialog.Dialog

    body, input
  • Constructor Details

    • PaperDialog

      protected PaperDialog(String defaultNamespace, Function<String,net.kyori.adventure.text.Component> componentDeserializer)
  • Method Details

    • title

      public T title(net.kyori.adventure.text.Component title)
      Specified by:
      title in interface io.github.projectunified.unidialog.adventure.dialog.AdventureDialog<org.bukkit.inventory.ItemStack,PaperDialogBodyBuilder,PaperDialogInputBuilder,T extends PaperDialog<T>>
    • externalTitle

      public T externalTitle(@Nullable @Nullable net.kyori.adventure.text.Component externalTitle)
      Specified by:
      externalTitle in interface io.github.projectunified.unidialog.adventure.dialog.AdventureDialog<org.bukkit.inventory.ItemStack,PaperDialogBodyBuilder,PaperDialogInputBuilder,T extends PaperDialog<T>>
    • getComponentDeserializer

      public Function<String,net.kyori.adventure.text.Component> getComponentDeserializer()
      Specified by:
      getComponentDeserializer in interface io.github.projectunified.unidialog.adventure.support.AdventureSupport
    • canCloseWithEscape

      public T canCloseWithEscape(boolean canCloseWithEscape)
      Specified by:
      canCloseWithEscape in interface io.github.projectunified.unidialog.core.dialog.Dialog<org.bukkit.inventory.ItemStack,PaperDialogBodyBuilder,PaperDialogInputBuilder,T extends PaperDialog<T>>
    • pause

      public T pause(boolean pause)
      Specified by:
      pause in interface io.github.projectunified.unidialog.core.dialog.Dialog<org.bukkit.inventory.ItemStack,PaperDialogBodyBuilder,PaperDialogInputBuilder,T extends PaperDialog<T>>
    • afterAction

      public T afterAction(io.github.projectunified.unidialog.core.dialog.Dialog.AfterAction afterAction)
      Specified by:
      afterAction in interface io.github.projectunified.unidialog.core.dialog.Dialog<org.bukkit.inventory.ItemStack,PaperDialogBodyBuilder,PaperDialogInputBuilder,T extends PaperDialog<T>>
    • body

      public T body(Consumer<PaperDialogBodyBuilder> bodyBuilder)
      Specified by:
      body in interface io.github.projectunified.unidialog.core.dialog.Dialog<org.bukkit.inventory.ItemStack,PaperDialogBodyBuilder,PaperDialogInputBuilder,T extends PaperDialog<T>>
    • input

      public T input(String key, Consumer<PaperDialogInputBuilder> inputBuilder)
      Specified by:
      input in interface io.github.projectunified.unidialog.core.dialog.Dialog<org.bukkit.inventory.ItemStack,PaperDialogBodyBuilder,PaperDialogInputBuilder,T extends PaperDialog<T>>
    • getAction

      protected io.papermc.paper.registry.data.dialog.ActionButton getAction(Consumer<PaperDialogActionBuilder> actionBuilder)
    • getDialogType

      protected abstract io.papermc.paper.registry.data.dialog.type.DialogType getDialogType()
    • getDialogBuilder

      public final Consumer<io.papermc.paper.registry.data.dialog.DialogRegistryEntry.Builder> getDialogBuilder()
      Get the dialog builder consumer that can be used to create a dialog
      Returns:
      a consumer that accepts a DialogRegistryEntry.Builder
    • getDialog

      public final io.papermc.paper.dialog.Dialog getDialog()
      Create a dialog using the provided factory
      Returns:
      a Dialog instance created using the dialog builder
    • register

      public final void register(net.kyori.adventure.key.Key key, io.papermc.paper.registry.event.WritableRegistry<io.papermc.paper.dialog.Dialog,io.papermc.paper.registry.data.dialog.DialogRegistryEntry.Builder> registry)
      Register the dialog with the provided key in the given registry.
      Parameters:
      key - the key to register the dialog under
      registry - the registry to register the dialog in
    • register

      public final void register(net.kyori.adventure.key.Key key, io.papermc.paper.registry.event.RegistryComposeEvent<io.papermc.paper.dialog.Dialog,io.papermc.paper.registry.data.dialog.DialogRegistryEntry.Builder> event)
      Register the dialog with the provided key using the given event.
      Parameters:
      key - the key to register the dialog under
      event - the registry compose event to register the dialog in
    • register

      public final void register(String namespace, String dialogId, io.papermc.paper.registry.event.WritableRegistry<io.papermc.paper.dialog.Dialog,io.papermc.paper.registry.data.dialog.DialogRegistryEntry.Builder> registry)
      Register the dialog with the default namespace and the provided dialog ID in the given registry.
      Parameters:
      namespace - the namespace to use
      dialogId - the dialog ID to register under
      registry - the registry to register the dialog in
    • register

      public final void register(String namespace, String dialogId, io.papermc.paper.registry.event.RegistryComposeEvent<io.papermc.paper.dialog.Dialog,io.papermc.paper.registry.data.dialog.DialogRegistryEntry.Builder> event)
      Register the dialog with the default namespace and the provided dialog ID using the given event.
      Parameters:
      namespace - the namespace to use
      dialogId - the dialog ID to register under
      event - the registry compose event to register the dialog in
    • register

      public final void register(String dialogId, io.papermc.paper.registry.event.WritableRegistry<io.papermc.paper.dialog.Dialog,io.papermc.paper.registry.data.dialog.DialogRegistryEntry.Builder> registry)
      Register the dialog with the default namespace and the provided dialog ID in the given registry.
      Parameters:
      dialogId - the dialog ID to register under
      registry - the registry to register the dialog in
    • register

      public final void register(String dialogId, io.papermc.paper.registry.event.RegistryComposeEvent<io.papermc.paper.dialog.Dialog,io.papermc.paper.registry.data.dialog.DialogRegistryEntry.Builder> event)
      Register the dialog with the default namespace and the provided dialog ID using the given event.
      Parameters:
      dialogId - the dialog ID to register under
      event - the registry compose event to register the dialog in
    • opener

      public PaperDialogOpener opener()
      Specified by:
      opener in interface io.github.projectunified.unidialog.core.dialog.Dialog<org.bukkit.inventory.ItemStack,PaperDialogBodyBuilder,PaperDialogInputBuilder,T extends PaperDialog<T>>