PocketMine-MP 5.17.1 git-df4ada81e5d74a14046f27cf44a37dcee69d657e
pocketmine\inventory\CallbackInventoryListener Class Reference
+ Inheritance diagram for pocketmine\inventory\CallbackInventoryListener:
+ Collaboration diagram for pocketmine\inventory\CallbackInventoryListener:

Public Member Functions

 __construct (private ?\Closure $onSlotChange, private ?\Closure $onContentChange)
 
 onContentChange (Inventory $inventory, array $oldContents)
 
 onSlotChange (Inventory $inventory, int $slot, Item $oldItem)
 

Static Public Member Functions

static onAnyChange (\Closure $onChange)
 

Detailed Description

Definition at line 29 of file CallbackInventoryListener.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\inventory\CallbackInventoryListener::__construct ( private ?\Closure  $onSlotChange,
private ?\Closure  $onContentChange 
)

@phpstan-param (\Closure(Inventory, int, Item) : void)|null $onSlotChange @phpstan-param (\Closure(Inventory, Item[]) : void)|null $onContentChange

Definition at line 37 of file CallbackInventoryListener.php.

References pocketmine\utils\Utils\validateCallableSignature().

+ Here is the call graph for this function:

Member Function Documentation

◆ onAnyChange()

static pocketmine\inventory\CallbackInventoryListener::onAnyChange ( \Closure  $onChange)
static

@phpstan-param \Closure(Inventory) : void $onChange

Definition at line 52 of file CallbackInventoryListener.php.

◆ onContentChange()

pocketmine\inventory\CallbackInventoryListener::onContentChange ( Inventory  $inventory,
array  $oldContents 
)
Parameters
Item[]$oldContents

Implements pocketmine\inventory\InventoryListener.

Definition at line 72 of file CallbackInventoryListener.php.

◆ onSlotChange()

pocketmine\inventory\CallbackInventoryListener::onSlotChange ( Inventory  $inventory,
int  $slot,
Item  $oldItem 
)

The documentation for this class was generated from the following file: