AbstractKtInventoryPaginatedLazyFetched

Base class for inventories that open immediately and populate entries after data is fetched asynchronously.

Since

2.2.0

Parameters

context

Plugin context

line

Number of inventory rows

Type Parameters

T

Type of the lazy fetched inventory

C

Type of the display condition

D

Type of the fetched data

Inheritors

Constructors

Link copied to clipboard
constructor(context: KtInventoryPluginContext.LazyFetchable, line: Int)

Types

Link copied to clipboard
abstract class Entry<T : AbstractKtInventoryPaginatedLazyFetched<T, C, D>, C : Any, D>(val paginated: T, val condition: C) : AbstractKtInventory

Represents a single lazy fetched inventory page.

Link copied to clipboard

Base class for refreshable lazy-fetched paginated inventories.

Properties

Link copied to clipboard

Map of all buttons in the inventory

Link copied to clipboard
abstract val initialCondition: C

Initial display condition used by open.

Link copied to clipboard
val line: Int

Number of rows in the inventory (must be between 1 and 6)

Link copied to clipboard

Set of all paged storables in this inventory.

Link copied to clipboard
val size: Int

Total size of inventory (line * 9)

Functions

Link copied to clipboard
override fun button(slot: Int, item: KtInventoryButton<KtInventoryBase>)

Adds an existing button to a single slot

fun button(vararg slot: Int, item: KtInventoryButton<KtInventoryBase>)

Adds an existing button to multiple slots

fun button(slot: Int, itemStack: ItemStack, onClick: (KtInventoryButton.ClickEvent<AbstractKtInventory>) -> Unit = {})

Adds a button to a single slot with the given item and click handler

fun button(slots: Iterable<Int>, itemStack: ItemStack, onClick: (KtInventoryButton.ClickEvent<AbstractKtInventory>) -> Unit = {})
fun button(vararg slot: Int, itemStack: ItemStack, onClick: (KtInventoryButton.ClickEvent<AbstractKtInventory>) -> Unit = {})

Adds a button to multiple slots with the given item and click handler

Link copied to clipboard
Link copied to clipboard

Adds a button to navigate to the next condition.

Link copied to clipboard
open fun onClick(event: InventoryClickEvent)

Called when top inventory is clicked

Link copied to clipboard
open fun onClickBottom(event: InventoryClickEvent)

Called when bottom inventory is clicked

Link copied to clipboard
open fun onClose(event: InventoryCloseEvent)

Called when inventory is closed

Link copied to clipboard
open fun onDrag(event: InventoryDragEvent)

Called when items are dragged in inventory

Link copied to clipboard
open fun onOpen(event: InventoryOpenEvent)

Called when inventory is opened

Link copied to clipboard
override fun open(player: HumanEntity)

Opens this inventory for the given player

fun open(player: HumanEntity, condition: C)

Opens the inventory immediately and populates entries after fetching data asynchronously.

Link copied to clipboard
fun paginateSlot(vararg slots: Int)

Sets slots to be used for pagination.

Link copied to clipboard

Adds a button to navigate to the previous condition.

Link copied to clipboard

Adds a storable that is applied to each created condition entry.