diff --git a/src/pocketmine/tile/Chest.php b/src/pocketmine/tile/Chest.php index 8262a23d1..719f3bec8 100644 --- a/src/pocketmine/tile/Chest.php +++ b/src/pocketmine/tile/Chest.php @@ -58,6 +58,19 @@ class Chest extends Spawnable implements InventoryHolder, Container{ $this->checkPairing(); } + public function close(){ + if($this->closed === false){ + foreach($this->getInventory()->getViewers() as $player){ + $this->getInventory()->close($player); + } + + foreach($this->getRealInventory()->getViewers() as $player){ + $this->getRealInventory()->close($player); + } + parent::close(); + } + } + public function saveNBT(){ $this->namedtag->Items = new Enum("Items", []); $this->namedtag->Items->setTagType(NBT::TAG_Compound); diff --git a/src/pocketmine/tile/Furnace.php b/src/pocketmine/tile/Furnace.php index c9760edcd..b4b4194a3 100644 --- a/src/pocketmine/tile/Furnace.php +++ b/src/pocketmine/tile/Furnace.php @@ -67,6 +67,15 @@ class Furnace extends Tile implements InventoryHolder, Container{ } } + public function close(){ + if($this->closed === false){ + foreach($this->getInventory()->getViewers() as $player){ + $this->getInventory()->close($player); + } + parent::close(); + } + } + public function saveNBT(){ $this->namedtag->Items = new Enum("Inventory", []); $this->namedtag->Items->setTagType(NBT::TAG_Compound);