Package-level declarations

Types

Link copied to clipboard
data class Button @JvmOverloads constructor(val slot: Int, val material: Material, val name: Component, val data: Map<NamespacedKey, DataWrapper<out Any, out Any>> = emptyMap(), var onClick: ClickEvent? = null, val skipGUIListenerCall: Boolean = true)

Represents a button in an inventory GUI. This class is used to define the properties and behavior of a button, including its material, display name, custom data, and click action.

Link copied to clipboard

Functional interface representing a click event action to be executed when a player interacts. This interface is designed to encapsulate a callback mechanism for handling click events associated with a specific player.

Link copied to clipboard
data class DataWrapper<P : Any, C : Any>(val dataType: PersistentDataType<P, C>, val value: C)

A wrapper class to encapsulate a value and its associated PersistentDataType. This class provides utility methods for interacting with PersistentDataContainers.

Link copied to clipboard
class DynamicGUI<S : Enum<S>>(enumClass: Class<S>, player: Player) : InventoryGUI

A generic dynamic GUI framework for creating inventories with an adaptive state-based design.

Link copied to clipboard
interface GUIListener
Link copied to clipboard
object IGF : Listener

Main handler for the InventoryGUI framework (IGF). It manages global listeners, event handling, and NamespacedKey initialization.

Link copied to clipboard
abstract class InventoryGUI(player: Player) : InventoryHolder

Represents a base class for creating custom inventory GUIs in Minecraft. This class provides basic inventory manipulation methods and allows setting up buttons, listeners, and background materials for GUI customization.

Link copied to clipboard
class PaginatedDynamicGUI<S : Enum<S>>(enumClass: Class<S>, player: Player) : InventoryGUI

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.

Link copied to clipboard
class PaginatedGUI(player: Player) : InventoryGUI

A class that provides paginated inventory GUI functionality with improved item management. It allows dynamic page navigation, slot management, and customization using PersistentDataContainer.

Link copied to clipboard
class SimpleGUI(player: Player) : InventoryGUI

A simple GUI class that provides basic inventory GUI functionality. It allows setting up buttons, listeners, and background materials for GUI customization. This class can be extended to create more complex GUIs.

Link copied to clipboard

Represents a single-page state for use with DynamicGUI.

Functions

Link copied to clipboard
fun Button.addData(vararg entries: Pair<NamespacedKey, DataWrapper<*, *>>): Button

Adds multiple persistent data entries to the button.

Link copied to clipboard
fun Button.appendClick(callback: (Player) -> Unit): Button

Adds a click handler to the button without overwriting the existing one. The new click handler is called after the existing click handler when the button is clicked.

Link copied to clipboard
inline fun <T : Any> ItemStack.getValue(key: NamespacedKey, dataType: PersistentDataType<T, T>): T?

Retrieves a value from the ItemStack's PersistentDataContainer.

Link copied to clipboard
inline fun <P : Any, C : Any> ItemStack.getWrapper(key: NamespacedKey, dataType: PersistentDataType<P, C>): DataWrapper<P, C>?

Retrieves a DataWrapper from the ItemStack's PersistentDataContainer.

Link copied to clipboard
fun Button.setClick(block: (Player) -> Unit): Button
fun <G> Button.setClick(gui: G, block: (Player, G) -> Unit): Button
fun <S : Enum<S>> Button.setClick(gui: DynamicGUI<S>, block: (Player, DynamicGUI<S>) -> Unit): Button
fun <S : Enum<S>> Button.setClick(gui: PaginatedDynamicGUI<S>, block: (Player, PaginatedDynamicGUI<S>) -> Unit): Button
Link copied to clipboard
inline fun <G : InventoryGUI> Button.setClickTyped(crossinline block: (Player, G) -> Unit): Button
fun <G : InventoryGUI> Button.setClickTyped(guiClass: Class<G>, block: (Player, G) -> Unit): Button
Link copied to clipboard
fun Button.setData(key: NamespacedKey, wrapper: DataWrapper<*, *>): Button

Sets or replaces a single persistent data entry in the button.

Link copied to clipboard
fun Material.toItemStack(name: Component? = null, data: Map<NamespacedKey, DataWrapper<*, *>> = emptyMap()): ItemStack

Converts the material into an ItemStack, optionally setting the display name and persistent data.