GuiRegistry

The GuiRegistry object serves as a registry for tracking and managing open GUI instances.

It maintains a mapping of open Inventory objects to their corresponding GuiBuilder instances.

Properties

Link copied to clipboard
val openGuis: MutableMap<Inventory, Any>

A mutable map that tracks open inventories and their associated GuiBuilder instances.

Functions

Link copied to clipboard
fun get(inventory: Inventory): Any?

Retrieves the GUI instance associated with a given inventory.

Link copied to clipboard
fun <T> getAs(inventory: Inventory): T?

Retrieves the GUI instance associated with a given inventory, casting it to a specific type.

Link copied to clipboard
fun register(inventory: Inventory, gui: Any): GuiRegistry

Registers a new inventory with its associated GUI instance.