Class BungeeDialog<O extends BungeeDialogOpener,T extends BungeeDialog<O,T>>

java.lang.Object
io.github.projectunified.unidialog.bungeecord.dialog.BungeeDialog<O,T>
Type Parameters:
O - the type of the dialog opener
T - the type of the dialog itself, for method chaining
All Implemented Interfaces:
Dialog<Object,BungeeDialogBodyBuilder,BungeeDialogInputBuilder,T>
Direct Known Subclasses:
BungeeConfirmationDialog, BungeeDialogListDialog, BungeeMultiActionDialog, BungeeNoticeDialog, BungeeServerLinksDialog

public abstract class BungeeDialog<O extends BungeeDialogOpener,T extends BungeeDialog<O,T>> extends Object implements Dialog<Object,BungeeDialogBodyBuilder,BungeeDialogInputBuilder,T>
The Bungee implementation of the dialog
  • Nested Class Summary

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

    Dialog.AfterAction
  • Constructor Summary

    Constructors
    Constructor
    Description
    BungeeDialog(String defaultNamespace, Function<net.md_5.bungee.api.dialog.Dialog,O> openerFunction)
    Create a new dialog
  • Method Summary

    Modifier and Type
    Method
    Description
    Set the action to be performed after an action is taken in the dialog
    Set the body of the dialog
    canCloseWithEscape(boolean canCloseWithEscape)
    Set the option to allow the dialog to be closed with the escape key
    protected abstract net.md_5.bungee.api.dialog.Dialog
    constructDialog(net.md_5.bungee.api.dialog.DialogBase dialogBase)
    Construct the Bungee dialog from the given dialog base
    externalTitle(@Nullable String externalTitle)
    Set the external title of the dialog, which is used for displaying the dialog in a multi-dialog dialog
    externalTitle(@Nullable net.md_5.bungee.api.chat.BaseComponent externalTitle)
    Set the external title of the dialog, which is used for displaying the dialog in a multi-dialog dialog
    protected net.md_5.bungee.api.dialog.action.ActionButton
    Build an action button from the given action builder consumer
    final net.md_5.bungee.api.dialog.Dialog
    Get the built Bungee dialog
    Set the input for the dialog
    Create an opener for the dialog
    pause(boolean pause)
    Set the option to pause the game while the dialog is open
    title(String title)
    Set the title of the dialog
    title(net.md_5.bungee.api.chat.BaseComponent title)
    Set the title of the dialog

    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.core.dialog.Dialog

    body, input
  • Constructor Details

    • BungeeDialog

      public BungeeDialog(String defaultNamespace, Function<net.md_5.bungee.api.dialog.Dialog,O> openerFunction)
      Create a new dialog
      Parameters:
      defaultNamespace - the default namespace for the dialog actions
      openerFunction - the function to create the dialog opener from the Bungee dialog
  • Method Details

    • title

      public T title(net.md_5.bungee.api.chat.BaseComponent title)
      Set the title of the dialog
      Parameters:
      title - the title of the dialog
      Returns:
      the dialog itself for method chaining
    • title

      public T title(String title)
      Description copied from interface: Dialog
      Set the title of the dialog
      Specified by:
      title in interface Dialog<Object,BungeeDialogBodyBuilder,BungeeDialogInputBuilder,T extends BungeeDialog<O,T>>
      Parameters:
      title - the title of the dialog
      Returns:
      the dialog itself for method chaining
    • externalTitle

      public T externalTitle(@Nullable @Nullable net.md_5.bungee.api.chat.BaseComponent externalTitle)
      Set the external title of the dialog, which is used for displaying the dialog in a multi-dialog dialog
      Parameters:
      externalTitle - the external title of the dialog
      Returns:
      the dialog itself for method chaining
    • externalTitle

      public T externalTitle(@Nullable @Nullable String externalTitle)
      Description copied from interface: Dialog
      Set the external title of the dialog, which is used for displaying the dialog in a multi-dialog dialog
      Specified by:
      externalTitle in interface Dialog<Object,BungeeDialogBodyBuilder,BungeeDialogInputBuilder,T extends BungeeDialog<O,T>>
      Parameters:
      externalTitle - the external title of the dialog
      Returns:
      the dialog itself for method chaining
    • canCloseWithEscape

      public T canCloseWithEscape(boolean canCloseWithEscape)
      Description copied from interface: Dialog
      Set the option to allow the dialog to be closed with the escape key
      Specified by:
      canCloseWithEscape in interface Dialog<Object,BungeeDialogBodyBuilder,BungeeDialogInputBuilder,T extends BungeeDialog<O,T>>
      Parameters:
      canCloseWithEscape - whether the dialog can be closed with the escape key
      Returns:
      the dialog itself for method chaining
    • pause

      public T pause(boolean pause)
      Description copied from interface: Dialog
      Set the option to pause the game while the dialog is open
      Specified by:
      pause in interface Dialog<Object,BungeeDialogBodyBuilder,BungeeDialogInputBuilder,T extends BungeeDialog<O,T>>
      Parameters:
      pause - whether the dialog should pause the game
      Returns:
      the dialog itself for method chaining
    • afterAction

      public T afterAction(Dialog.AfterAction afterAction)
      Description copied from interface: Dialog
      Set the action to be performed after an action is taken in the dialog
      Specified by:
      afterAction in interface Dialog<Object,BungeeDialogBodyBuilder,BungeeDialogInputBuilder,T extends BungeeDialog<O,T>>
      Parameters:
      afterAction - the action to be performed after an action is taken
      Returns:
      the dialog itself for method chaining
    • body

      public T body(Consumer<BungeeDialogBodyBuilder> bodyBuilder)
      Description copied from interface: Dialog
      Set the body of the dialog
      Specified by:
      body in interface Dialog<Object,BungeeDialogBodyBuilder,BungeeDialogInputBuilder,T extends BungeeDialog<O,T>>
      Parameters:
      bodyBuilder - the body builder for the dialog
      Returns:
      the dialog itself for method chaining
    • input

      public T input(String key, Consumer<BungeeDialogInputBuilder> inputBuilder)
      Description copied from interface: Dialog
      Set the input for the dialog
      Specified by:
      input in interface Dialog<Object,BungeeDialogBodyBuilder,BungeeDialogInputBuilder,T extends BungeeDialog<O,T>>
      Parameters:
      key - the key for the input
      inputBuilder - the input builder for the dialog
      Returns:
      the dialog itself for method chaining
    • getAction

      protected net.md_5.bungee.api.dialog.action.ActionButton getAction(Consumer<BungeeDialogActionBuilder> action)
      Build an action button from the given action builder consumer
      Parameters:
      action - the consumer to configure the action builder
      Returns:
      the built action button
    • constructDialog

      protected abstract net.md_5.bungee.api.dialog.Dialog constructDialog(net.md_5.bungee.api.dialog.DialogBase dialogBase)
      Construct the Bungee dialog from the given dialog base
      Parameters:
      dialogBase - the dialog base containing the shared dialog data
      Returns:
      the constructed Bungee dialog
    • getDialog

      public final net.md_5.bungee.api.dialog.Dialog getDialog()
      Get the built Bungee dialog
      Returns:
      the built Bungee dialog
    • opener

      public O opener()
      Description copied from interface: Dialog
      Create an opener for the dialog
      Specified by:
      opener in interface Dialog<Object,BungeeDialogBodyBuilder,BungeeDialogInputBuilder,T extends BungeeDialog<O,T>>
      Returns:
      the dialog opener