Paginated Dynamic GUI
A generic class used to create a paginated GUI in Minecraft, allowing dynamic switching between pages and states mapped to an enum type. It supports custom item mappings, navigation buttons, and empty state messages to provide a flexible inventory GUI system.
Parameters
the enum type for state management must extend Enum
the class of the enum used for managing GUI states
the player associated with the GUI
Types
Properties
Functions
Adds a single item to the existing item list.
Constructs and prepares the InventoryGUI object for use by setting the appropriate state and displaying it. If the currentState
is null and the enumClass
corresponds to SinglePage
, it initializes currentState
with SinglePage.PAGE
.
Gets the background material set for the inventory GUI.
Returns the inventory associated with this GUI.
Gets the current listener associated with this GUI.
Sets a handler to be called when this GUI is closed.
Sets the background material for the inventory GUI.
Sets the button to be displayed when the paginated GUI has no items to show.
Sets multiple items at once for the GUI. This replaces the existing item list.
Sets the number of items that should be displayed per page in the GUI.
Sets the listener for handling GUI events.
Sets the buttons used to navigate between pages in the paginated GUI. The provided buttons will be assigned click actions to move to the previous or next page.
Sets the button provider function for generating buttons based on the current state. This function is called to create a list of buttons whenever the state changes, allowing for dynamic button generation.
Sets the items to be paginated.
Specifies which states should use pagination.
Sets whether the global listener should be called on inventory events.
Sets the size of the inventory GUI.
Sets the slot positions for the inventory GUI.
Updates the current state of the paginated dynamic GUI and resets the current page to the first one.
Sets the providers for fixed buttons associated with each state.
Sets the title of the inventory GUI.
Sets the total number of pages. This method should be called after setting up items.
Indicates whether the global listener should be called on inventory events.
Switches the current page of the paginated GUI to the specified page index and updates its display.
Switches the current state of the GUI to the specified state. If the given state is different from the current state, it updates the state, resets the current page to the first page (index 0), and updates the display.