Kt Inventory Adventure
An abstract inventory implementation that uses Adventure's Component for titles.
Since
2.0.0
Parameters
plugin
The plugin instance
line
Number of inventory rows
Properties
Functions
Link copied to clipboard
Adds an existing button to a single slot
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(vararg slot: Int, itemStack: ItemStack, onClick: (KtInventoryButton.ClickEvent<AbstractKtInventory>) -> Unit = {})
fun button(slots: Iterable<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
fun createButton(itemStack: ItemStack, onClick: (KtInventoryButton.ClickEvent<AbstractKtInventory>) -> Unit): KtInventoryButton<AbstractKtInventory>
Creates a new inventory button with the specified item and click handler
Link copied to clipboard
Link copied to clipboard
Gets all storables that have the given slot
Gets all storables that have any of the given slots
Link copied to clipboard
Called when bottom inventory is clicked
Link copied to clipboard
Saves the state of all storable components in this inventory
Link copied to clipboard
fun storable(initialize: () -> List<ItemStack?> = { emptyList() }, onPreClick: (KtInventoryStorable.ClickEvent) -> KtInventoryStorable.EventResult = { KtInventoryStorable.EventResult.Allow }, onClick: (KtInventoryStorable.ClickEvent) -> Unit = {}, onPreDrag: (KtInventoryStorable.DragEvent) -> KtInventoryStorable.EventResult = { KtInventoryStorable.EventResult.Allow }, onDrag: (KtInventoryStorable.DragEvent) -> Unit = {}, save: (List<ItemStack?>) -> Unit = {})
Add a storable component using all slots in the inventory
fun storable(vararg slots: Int, initialize: () -> List<ItemStack?> = { emptyList() }, onPreClick: (KtInventoryStorable.ClickEvent) -> KtInventoryStorable.EventResult = { KtInventoryStorable.EventResult.Allow }, onClick: (KtInventoryStorable.ClickEvent) -> Unit = {}, onPreDrag: (KtInventoryStorable.DragEvent) -> KtInventoryStorable.EventResult = { KtInventoryStorable.EventResult.Allow }, onDrag: (KtInventoryStorable.DragEvent) -> Unit = {}, save: (List<ItemStack?>) -> Unit = {})
fun storable(slots: Iterable<Int>, initialize: () -> List<ItemStack?> = { emptyList() }, onPreClick: (KtInventoryStorable.ClickEvent) -> KtInventoryStorable.EventResult = { KtInventoryStorable.EventResult.Allow }, onClick: (KtInventoryStorable.ClickEvent) -> Unit = {}, onPreDrag: (KtInventoryStorable.DragEvent) -> KtInventoryStorable.EventResult = { KtInventoryStorable.EventResult.Allow }, onDrag: (KtInventoryStorable.DragEvent) -> Unit = {}, save: (List<ItemStack?>) -> Unit = {}): KtInventoryStorable
Add a storable component with the specified slot numbers