Refreshable

Abstract class for refreshable sequence-backed inventories.

Since

2.2.0

Parameters

clazz

The KClass of the sequence-backed inventory type

Type Parameters

T

Type of the sequence-backed inventory

Constructors

Link copied to clipboard
constructor(clazz: KClass<T>)

Properties

Link copied to clipboard
val clazz: KClass<T>

Functions

Link copied to clipboard
abstract override fun createNew(player: HumanEntity, inventory: AbstractKtInventoryPaginatedSequence.Entry<T>): T?

Creates new inventory instance.

Link copied to clipboard
override fun refresh(player: HumanEntity, inventory: AbstractKtInventoryPaginatedSequence.Entry<T>)

Refreshes the specified inventory for the player.

override fun refresh(player: HumanEntity, predicate: (AbstractKtInventoryPaginatedSequence.Entry<T>) -> Boolean = { true }): Boolean

Refreshes the inventory for the specified player based on a given predicate.

fun refresh(player: HumanEntity, inventory: AbstractKtInventoryPaginatedSequence.Entry<T>, behavior: AbstractKtInventoryPaginatedSequence.Refreshable.RefreshBehavior = RefreshBehavior.OpenFirst)

Refreshes specific inventory page for a player.

Refreshes inventory for a player if predicate matches.

Link copied to clipboard
override fun refreshAll(predicate: (Player, AbstractKtInventoryPaginatedSequence.Entry<T>) -> Boolean = { _, _ -> true })

Refreshes all inventories that match the given predicate.

fun refreshAll(behavior: AbstractKtInventoryPaginatedSequence.Refreshable.RefreshBehavior = RefreshBehavior.OpenFirst, predicate: (Player, AbstractKtInventoryPaginatedSequence.Entry<T>) -> Boolean = { _, _ -> true })

Refreshes inventory for all matching viewers.