Class BasePaginationPage

java.lang.Object
mc.obliviate.inventory.Gui
com.ultikits.ultitools.abstracts.gui.BaseInventoryPage
com.ultikits.ultitools.abstracts.gui.BasePaginationPage
All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder

public abstract class BasePaginationPage extends BaseInventoryPage
Base class for paginated inventory pages. Provides automatic pagination with next/previous buttons.

分页背包页面的基类。 提供带有下一页/上一页按钮的自动分页。

Since:
6.2.0
Version:
2.0.0
Author:
wisdomme
  • Field Details

    • paginationManager

      private final mc.obliviate.inventory.pagination.PaginationManager paginationManager
    • PREV_BUTTON_COLUMN

      protected static final int PREV_BUTTON_COLUMN
      Default column for the "previous" button (0-based)
      See Also:
    • NEXT_BUTTON_COLUMN

      protected static final int NEXT_BUTTON_COLUMN
      Default column for the "next" button (0-based)
      See Also:
  • Constructor Details

    • BasePaginationPage

      public BasePaginationPage(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String id, String title, int rows)
    • BasePaginationPage

      public BasePaginationPage(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String id, String title, org.bukkit.event.inventory.InventoryType inventoryType)
    • BasePaginationPage

      public BasePaginationPage(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String id, net.kyori.adventure.text.Component title, int rows)
    • BasePaginationPage

      public BasePaginationPage(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String id, net.kyori.adventure.text.Component title, org.bukkit.event.inventory.InventoryType inventoryType)
  • Method Details

    • initPagination

      private void initPagination()
      Initializes the pagination manager.

      初始化分页管理器。

    • setupContent

      protected final void setupContent(org.bukkit.event.inventory.InventoryOpenEvent event)
      Description copied from class: BaseInventoryPage
      Sets up the GUI content. Override this method to add custom content.

      设置 GUI 内容。重写此方法以添加自定义内容。

      Specified by:
      setupContent in class BaseInventoryPage
      Parameters:
      event - the inventory open event
    • updatePaginatedContent

      protected void updatePaginatedContent()
      Updates the paginated content.

      更新分页内容。

    • setupNavigationButtons

      protected void setupNavigationButtons()
      Sets up the navigation buttons.

      设置导航按钮。

    • createPreviousButton

      protected mc.obliviate.inventory.Icon createPreviousButton()
      Creates the "previous page" button. Override to customize.

      创建"上一页"按钮。 重写以自定义。

      Returns:
      the previous button icon
    • createNextButton

      protected mc.obliviate.inventory.Icon createNextButton()
      Creates the "next page" button. Override to customize.

      创建"下一页"按钮。 重写以自定义。

      Returns:
      the next button icon
    • provideItems

      protected abstract List<mc.obliviate.inventory.Icon> provideItems()
      Provides the items for pagination. Override this method to provide the items to display.

      提供分页的项目。 重写此方法以提供要显示的项目。

      Returns:
      list of icons to paginate
    • getPaginationManager

      protected mc.obliviate.inventory.pagination.PaginationManager getPaginationManager()
      Gets the pagination manager.

      获取分页管理器。

      Returns:
      the pagination manager
    • getCurrentPage

      public int getCurrentPage()
      Gets the current page number (1-based).

      获取当前页码(从 1 开始)。

      Returns:
      the current page number
    • getTotalPages

      public int getTotalPages()
      Gets the total number of pages.

      获取总页数。

      Returns:
      the total page count
    • hasNextPage

      public boolean hasNextPage()
      Checks if there are more pages after the current one.

      检查当前页之后是否还有更多页。

      Returns:
      true if not on the last page
    • hasPreviousPage

      public boolean hasPreviousPage()
      Checks if there are pages before the current one.

      检查当前页之前是否还有页。

      Returns:
      true if not on the first page
    • goToPage

      public void goToPage(int page)
      Goes to a specific page.

      跳转到指定页。

      Parameters:
      page - the page number (1-based)