mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Inventory: added removeAllListeners()
this isn't strictly necessary because it could be done by removeListeners(...getListeners()), but I think developers will appreciate not needing so much boilerplate code.
This commit is contained in:
@ -384,6 +384,10 @@ abstract class BaseInventory implements Inventory{
|
||||
}
|
||||
}
|
||||
|
||||
public function removeAllListeners() : void{
|
||||
$this->listeners = [];
|
||||
}
|
||||
|
||||
public function getListeners() : array{
|
||||
return $this->listeners;
|
||||
}
|
||||
|
@ -164,6 +164,8 @@ interface Inventory{
|
||||
*/
|
||||
public function removeListeners(InventoryListener ...$listeners) : void;
|
||||
|
||||
public function removeAllListeners() : void;
|
||||
|
||||
/**
|
||||
* @return InventoryListener[]
|
||||
*/
|
||||
|
Reference in New Issue
Block a user