Added BaseInventory->removeAllViewers()

This commit is contained in:
Dylan K. Taylor
2017-10-16 11:15:03 +01:00
parent 1641183674
commit 68809d992b
4 changed files with 15 additions and 15 deletions

View File

@ -59,15 +59,10 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
public function close(){
if($this->closed === false){
foreach($this->getInventory()->getViewers() as $player){
$player->removeWindow($this->getInventory());
}
foreach($this->getInventory()->getViewers() as $player){
$player->removeWindow($this->getRealInventory());
}
$this->inventory->removeAllViewers(true);
if($this->doubleInventory !== null){
$this->doubleInventory->removeAllViewers(true);
$this->doubleInventory->invalidate();
$this->doubleInventory = null;
}