Refreshable

abstract class Refreshable<T : AbstractKtInventory>(val clazz: KClass<T>) : RefreshableInventory<T>

Abstract class for implementing inventory refresh functionality

Since

2.0.0

Parameters

T

The type of inventory to refresh

clazz

The class of the inventory type

Constructors

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

Properties

Link copied to clipboard
val clazz: KClass<T>

Functions

Link copied to clipboard
abstract fun createNew(player: HumanEntity, inventory: T): T?

Creates a new instance of the inventory for refreshing.

Link copied to clipboard
override fun refresh(player: HumanEntity, inventory: T)

Refreshes the specified inventory for the player.

override fun refresh(player: HumanEntity, predicate: (T) -> Boolean): Boolean

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

Link copied to clipboard
override fun refreshAll(predicate: (Player, T) -> Boolean)

Refreshes all inventories that match the given predicate.