Interface PaginationSession<C,T,X extends AbstractPageContext<C,T,?>>

All Known Implementing Classes:
DefaultPaginationSession

public interface PaginationSession<C,T,X extends AbstractPageContext<C,T,?>>
Live pagination state for one player.

A session tracks the current page and opens page menus as the player navigates.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the session and the viewer's inventory.
    int
    Returns the current page index.
    @NotNull AbstractPagination<C,T,? super X>
    Returns the shared pagination definition.
    void
    goTo(int pageIndex)
    Opens the given page index.
    default boolean
    Returns whether the current page is the first page.
    default boolean
    Returns whether the current page is the last page.
    void
    Opens the next page when possible.
    void
    Opens the previous page when possible.
    void
    Rebuilds the session snapshot and reopens the current page from scratch.
    int
    Returns the total number of pages.
    @NotNull org.bukkit.entity.Player
    Returns the player viewing this session.
  • Method Details

    • definition

      @NotNull @NotNull AbstractPagination<C,T,? super X> definition()
      Returns the shared pagination definition.
    • viewer

      @NotNull @NotNull org.bukkit.entity.Player viewer()
      Returns the player viewing this session.
    • currentIndex

      int currentIndex()
      Returns the current page index.
    • totalPages

      int totalPages()
      Returns the total number of pages.
    • next

      void next()
      Opens the next page when possible.
    • previous

      void previous()
      Opens the previous page when possible.
    • goTo

      void goTo(int pageIndex)
      Opens the given page index.
    • reload

      void reload()
      Rebuilds the session snapshot and reopens the current page from scratch. This recalculates page count and re-renders title, capacity, and content.
    • close

      void close()
      Closes the session and the viewer's inventory.
    • isFirst

      default boolean isFirst()
      Returns whether the current page is the first page.
    • isLast

      default boolean isLast()
      Returns whether the current page is the last page.