mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 06:55:29 +00:00
Fixed cyclic reference with chest tiles and DoubleChestInventory
This commit is contained in:
parent
1d338bfdf9
commit
0b83c61494
@ -139,4 +139,9 @@ class DoubleChestInventory extends ChestInventory implements InventoryHolder{
|
|||||||
public function getRightSide() : ChestInventory{
|
public function getRightSide() : ChestInventory{
|
||||||
return $this->right;
|
return $this->right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function invalidate(){
|
||||||
|
$this->left = null;
|
||||||
|
$this->right = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,8 +67,12 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
|
|||||||
$player->removeWindow($this->getRealInventory());
|
$player->removeWindow($this->getRealInventory());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($this->doubleInventory !== null){
|
||||||
|
$this->doubleInventory->invalidate();
|
||||||
|
$this->doubleInventory = null;
|
||||||
|
}
|
||||||
|
|
||||||
$this->inventory = null;
|
$this->inventory = null;
|
||||||
$this->doubleInventory = null;
|
|
||||||
|
|
||||||
parent::close();
|
parent::close();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user