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>
  • Constructor Details

  • Method Details

    • getComponentDeserializer

      public Function<String,net.kyori.adventure.text.Component> getComponentDeserializer()
      Description copied from interface: AdventureSupport
      Get the deserializer function that converts a string to a Component
      Specified by:
      getComponentDeserializer in interface AdventureSupport
      Returns:
      the function that deserializes a string into a Component
    • title

      public T title(net.kyori.adventure.text.Component title)
      Description copied from interface: AdventureDialog
      Set the title of the dialog
      Specified by:
      title in interface AdventureDialog<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

      public T externalTitle(@Nullable @Nullable net.kyori.adventure.text.Component 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 interface AdventureDialog<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

      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<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

      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<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

      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<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

      public T body(Consumer<PEDialogBodyBuilder> bodyBuilder)
      Description copied from interface: Dialog
      Set the body of the dialog
      Specified by:
      body in interface Dialog<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

      public T input(String key, Consumer<PEDialogInputBuilder> inputBuilder)
      Description copied from interface: Dialog
      Set the input for the dialog
      Specified by:
      input in interface Dialog<com.github.retrooper.packetevents.protocol.item.ItemStack,PEDialogBodyBuilder,PEDialogInputBuilder,T extends PEDialog<T>>
      Parameters:
      key - the key for the input
      inputBuilder - 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

      public PEDialogOpener opener()
      Description copied from interface: Dialog
      Create an opener for the dialog
      Specified by:
      opener in interface Dialog<com.github.retrooper.packetevents.protocol.item.ItemStack,PEDialogBodyBuilder,PEDialogInputBuilder,T extends PEDialog<T>>
      Returns:
      the dialog opener