PaginatedGuiBuilder

A PaginatedGuiBuilder is used to create a paginated GUI, allowing players to navigate through multiple pages of items. This builder provides functionality for setting up items, page navigation buttons, and customizing the look of each page.

Parameters

baseTitle

The base title of the paginated GUI.

rows

The number of rows in the GUI.

data

The list of data to be displayed in the GUI, which will be paginated.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun border(item: ItemStack): PaginatedGuiBuilder<T>

Sets a border around the inventory, filling the outermost slots with the specified item.

Link copied to clipboard
fun fillAll(item: ItemStack): PaginatedGuiBuilder<T>

Sets a default item to fill the entire inventory.

Link copied to clipboard
fun fillSlots(vararg slot: Int, item: ItemStack): PaginatedGuiBuilder<T>

Sets custom items for specific slots in the GUI.

Link copied to clipboard
fun maxPage(): Int

Calculates the maximum number of pages, based on the number of items and items per page.

Link copied to clipboard

Defines the button for navigating to the next page.

Link copied to clipboard

Increases the current page by 1, if it's not the last page.

Link copied to clipboard
fun open(player: Player)

Opens the paginated GUI for the specified player.

Link copied to clipboard
fun page(number: Int): PaginatedGuiBuilder<T>

Sets the current page to a specific page number, ensuring it's within valid bounds.

Link copied to clipboard

Specifies the slot for displaying the page indicator (e.g., "Page 1/5").

Link copied to clipboard

Defines the button for navigating to the previous page.

Link copied to clipboard

Decreases the current page by 1, if it is greater than 1.

Link copied to clipboard

Defines how to render each item in the list of data within the GUI.

Link copied to clipboard
fun slots(vararg customSlots: Int): PaginatedGuiBuilder<T>

Specifies the custom slots to be used in the GUI.

Link copied to clipboard
fun titleFormatter(formatter: (current: Int, max: Int) -> String): PaginatedGuiBuilder<T>

Sets a custom title formatter for the paginated GUI.