Inventory: Add a $send parameter to clearAll()

This commit is contained in:
Dylan K. Taylor
2018-01-22 18:39:35 +00:00
parent 897a31e608
commit 69ddaacc28
3 changed files with 12 additions and 6 deletions

View File

@ -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());
}
}
/**