mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Cleaned up Entity->close() handling
This commit is contained in:
@ -883,18 +883,16 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
}
|
||||
}
|
||||
|
||||
public function close() : void{
|
||||
if(!$this->closed){
|
||||
if($this->inventory !== null){
|
||||
$this->inventory->removeAllViewers(true);
|
||||
$this->inventory = null;
|
||||
}
|
||||
if($this->enderChestInventory !== null){
|
||||
$this->enderChestInventory->removeAllViewers(true);
|
||||
$this->enderChestInventory = null;
|
||||
}
|
||||
parent::close();
|
||||
}
|
||||
protected function onDispose() : void{
|
||||
$this->inventory->removeAllViewers(true);
|
||||
$this->enderChestInventory->removeAllViewers(true);
|
||||
parent::onDispose();
|
||||
}
|
||||
|
||||
protected function destroyCycles() : void{
|
||||
$this->inventory = null;
|
||||
$this->enderChestInventory = null;
|
||||
parent::destroyCycles();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user