Documentation

CallbackInventoryListener
in package
implements InventoryListener

Interfaces, Classes, Traits and Enums

InventoryListener
Classes implementing this interface can be injected into inventories to receive notifications when content changes occur.

Table of Contents

$onContentChangeCallback  : Closure|null
$onSlotChangeCallback  : Closure|null
__construct()  : mixed
onAnyChange()  : self
onContentChange()  : void
onSlotChange()  : void

Properties

$onContentChangeCallback

private Closure|null $onContentChangeCallback
Tags
phpstan-var

(\Closure(Inventory, Item[]) : void)|null

$onSlotChangeCallback

private Closure|null $onSlotChangeCallback
Tags
phpstan-var

(\Closure(Inventory, int, Item) : void)|null

Methods

__construct()

public __construct(Closure|null $onSlotChange, Closure|null $onContentChange) : mixed
Parameters
$onSlotChange : Closure|null
$onContentChange : Closure|null
Tags
phpstan-param

(\Closure(Inventory, int, Item) : void)|null $onSlotChange

phpstan-param

(\Closure(Inventory, Item[]) : void)|null $onContentChange

Return values
mixed

onAnyChange()

public static onAnyChange(Closure $onChange) : self
Parameters
$onChange : Closure
Tags
phpstan-param

\Closure(Inventory) : void $onChange

Return values
self

Search results