Class PageHelper
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.gps.PageHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidrenderPageButton(ChestMenu menu, int prevSlot, int nextSlot, PageRange pr, ChestMenu.MenuClickHandler prevHander, ChestMenu.MenuClickHandler nextHander) This method renders the pagination buttons for a pagedChestMenu.
-
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 pagedChestMenu.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 inprevSlot. Whenpage < totalPages, a clickable "next page" button will be rendered innextSlot. Disabled buttons are displayed as non-interactable gray panes.- Parameters:
menu- TheChestMenuto render the pagination controls intoprevSlot- The inventory slot used for the "previous page" buttonnextSlot- The inventory slot used for the "next page" buttonpr- ThePageRangedefining the current page index and total page countprevHander- TheChestMenu.MenuClickHandlerto be executed when the player clicks the "previous page" button. This handler is only applied when the button is active.nextHander- TheChestMenu.MenuClickHandlerto be executed when the player clicks the "next page" button. This handler is only applied when the button is active.
-