mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 20:14:31 +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{
|
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[]
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user