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
$onSlotChangeCallback
private
Closure|null
$onSlotChangeCallback
Tags
Methods
__construct()
public
__construct(Closure|null $onSlotChange, Closure|null $onContentChange) : mixed
Parameters
- $onSlotChange : Closure|null
- $onContentChange : Closure|null
Tags
Return values
mixed —onAnyChange()
public
static onAnyChange(Closure $onChange) : self
Parameters
- $onChange : Closure
Tags
Return values
self —onContentChange()
public
onContentChange(Inventory $inventory, array<string|int, Item> $oldContents) : void
Parameters
Return values
void —onSlotChange()
public
onSlotChange(Inventory $inventory, int $slot, Item $oldItem) : void