Class ScrollingModal

All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder

public class ScrollingModal extends PaginatedModal
Modal that allows you to scroll through items
  • Constructor Details

    • ScrollingModal

      public ScrollingModal(@NotNull @NotNull ModalContainer modalContainer, int pageSize, @NotNull @NotNull ScrollType scrollType, @NotNull @NotNull Set<InteractionModifier> interactionModifiers)
    • ScrollingModal

      public ScrollingModal(@NotNull @NotNull ModalContainer modalContainer, @NotNull @NotNull PaginationRegion paginationRegion, @NotNull @NotNull ScrollType scrollType, @NotNull @NotNull Set<InteractionModifier> interactionModifiers)
      Constructor with pagination region
      Parameters:
      modalContainer - Modal container
      paginationRegion - Region for pagination items
      scrollType - Scrolling direction
      interactionModifiers - Interaction modifiers
  • Method Details

    • setDynamicTitle

      public ScrollingModal setDynamicTitle(@NotNull @NotNull String baseTitle)
      Sets a dynamic title that updates with scrolling position
      Overrides:
      setDynamicTitle in class PaginatedModal
      Parameters:
      baseTitle - Base title text
      Returns:
      The modal
    • next

      public boolean next()
      Overrides PaginatedModal.next() to make it work with the specific scrolls
      Overrides:
      next in class PaginatedModal
      Returns:
      False if there is no next page.
    • previous

      public boolean previous()
      Overrides PaginatedModal.previous() to make it work with the specific scrolls
      Overrides:
      previous in class PaginatedModal
      Returns:
      False if there is no previous page.
    • open

      public void open(@NotNull @NotNull org.bukkit.entity.HumanEntity player)
      Overrides PaginatedModal.open(HumanEntity) to make it work with the specific scrolls
      Overrides:
      open in class PaginatedModal
      Parameters:
      player - The HumanEntity to open the modal to
    • open

      public void open(@NotNull @NotNull org.bukkit.entity.HumanEntity player, int openPage)
      Overrides PaginatedModal.open(HumanEntity, int) to make it work with the specific scrolls
      Overrides:
      open in class PaginatedModal
      Parameters:
      player - The HumanEntity to open the modal to
      openPage - The page to open on