mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +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:
parent
8682ea35f7
commit
6e6fffa461
@ -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[]
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user