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

@ -351,12 +351,14 @@ abstract class BaseInventory implements Inventory{
return $this->setItem($index, ItemFactory::get(Item::AIR, 0, 0), $send);
}
public function clearAll() : void{
public function clearAll(bool $send = true) : void{
for($i = 0, $size = $this->getSize(); $i < $size; ++$i){
$this->clear($i, false);
}
$this->sendContents($this->getViewers());
if($send){
$this->sendContents($this->getViewers());
}
}
/**