diff --git a/src/pocketmine/inventory/DoubleChestInventory.php b/src/pocketmine/inventory/DoubleChestInventory.php index 3b68ef889..e588de9dc 100644 --- a/src/pocketmine/inventory/DoubleChestInventory.php +++ b/src/pocketmine/inventory/DoubleChestInventory.php @@ -139,4 +139,9 @@ class DoubleChestInventory extends ChestInventory implements InventoryHolder{ public function getRightSide() : ChestInventory{ return $this->right; } + + public function invalidate(){ + $this->left = null; + $this->right = null; + } } diff --git a/src/pocketmine/tile/Chest.php b/src/pocketmine/tile/Chest.php index fc3e472f3..edce48f0a 100644 --- a/src/pocketmine/tile/Chest.php +++ b/src/pocketmine/tile/Chest.php @@ -67,8 +67,12 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{ $player->removeWindow($this->getRealInventory()); } + if($this->doubleInventory !== null){ + $this->doubleInventory->invalidate(); + $this->doubleInventory = null; + } + $this->inventory = null; - $this->doubleInventory = null; parent::close(); }