mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Inventory: Add a $send parameter to clearAll()
This commit is contained in:
@ -282,14 +282,16 @@ class PlayerInventory extends EntityInventory{
|
||||
return parent::doSetItemEvents($index, $newItem);
|
||||
}
|
||||
|
||||
public function clearAll() : void{
|
||||
parent::clearAll();
|
||||
public function clearAll(bool $send = true) : void{
|
||||
parent::clearAll($send);
|
||||
|
||||
for($i = $this->getSize(), $m = $i + 4; $i < $m; ++$i){
|
||||
$this->clear($i, false);
|
||||
}
|
||||
|
||||
$this->sendArmorContents($this->getViewers());
|
||||
if($send){
|
||||
$this->sendArmorContents($this->getViewers());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user