Refreshable

Base class for refreshable paginated inventories

Since

2.0.0

Parameters

T

Type of the paginated inventory

clazz

Class of the paginated inventory

Inheritors

Constructors

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

Types

Link copied to clipboard

Defines how inventory should be refreshed

Properties

Link copied to clipboard
val clazz: KClass<T>

Functions

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

Creates new inventory instance

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

Refreshes the specified inventory for the player.

override fun refresh(player: HumanEntity, predicate: (AbstractKtInventoryPaginated.Entry<T>) -> Boolean): Boolean

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

fun refresh(player: HumanEntity, inventory: AbstractKtInventoryPaginated.Entry<T>, behavior: AbstractKtInventoryPaginated.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, AbstractKtInventoryPaginated.Entry<T>) -> Boolean)

Refreshes all inventories that match the given predicate.

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

Refreshes inventory for all matching viewers