Class PageHelper

java.lang.Object
io.github.thebusybiscuit.slimefun4.api.gps.PageHelper

public class PageHelper extends Object
  • Constructor Details

    • PageHelper

      public PageHelper()
  • Method Details

    • renderPageButton

      @ParametersAreNonnullByDefault public static void renderPageButton(ChestMenu menu, int prevSlot, int nextSlot, PageRange pr, ChestMenu.MenuClickHandler prevHander, ChestMenu.MenuClickHandler nextHander)
      This method renders the pagination buttons for a paged ChestMenu.

      The pagination logic follows a 1-based page index. If the total amount of pages is greater than one, this method will add interactive "previous" and "next" buttons to the provided slot positions. Otherwise, both slots will be filled with a background item and no interaction will be allowed.

      When page > 1, a clickable "previous page" button will be rendered in prevSlot. When page < totalPages, a clickable "next page" button will be rendered in nextSlot. Disabled buttons are displayed as non-interactable gray panes.

      Parameters:
      menu - The ChestMenu to render the pagination controls into
      prevSlot - The inventory slot used for the "previous page" button
      nextSlot - The inventory slot used for the "next page" button
      pr - The PageRange defining the current page index and total page count
      prevHander - The ChestMenu.MenuClickHandler to be executed when the player clicks the "previous page" button. This handler is only applied when the button is active.
      nextHander - The ChestMenu.MenuClickHandler to be executed when the player clicks the "next page" button. This handler is only applied when the button is active.