mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 01:39:52 +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{
|
public function getListeners() : array{
|
||||||
return $this->listeners;
|
return $this->listeners;
|
||||||
}
|
}
|
||||||
|
@ -164,6 +164,8 @@ interface Inventory{
|
|||||||
*/
|
*/
|
||||||
public function removeListeners(InventoryListener ...$listeners) : void;
|
public function removeListeners(InventoryListener ...$listeners) : void;
|
||||||
|
|
||||||
|
public function removeAllListeners() : void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return InventoryListener[]
|
* @return InventoryListener[]
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user