Properly close inventory windows from Players

This commit is contained in:
Shoghi Cervantes
2014-11-27 13:32:07 +01:00
parent 441a98e60a
commit a3e50f6337
4 changed files with 8 additions and 6 deletions

View File

@ -59,11 +59,11 @@ class Chest extends Spawnable implements InventoryHolder, Container{
public function close(){
if($this->closed === false){
foreach($this->getInventory()->getViewers() as $player){
$this->getInventory()->close($player);
$player->removeWindow($this->getInventory());
}
foreach($this->getRealInventory()->getViewers() as $player){
$this->getRealInventory()->close($player);
foreach($this->getInventory()->getViewers() as $player){
$player->removeWindow($this->getRealInventory());
}
parent::close();
}

View File

@ -71,7 +71,7 @@ class Furnace extends Tile implements InventoryHolder, Container{
public function close(){
if($this->closed === false){
foreach($this->getInventory()->getViewers() as $player){
$this->getInventory()->close($player);
$player->removeWindow($this->getInventory());
}
parent::close();
}