mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 15:41:33 +00:00
Improved inventory and window allocation, fixes #2200
This commit is contained in:
@@ -1185,8 +1185,8 @@ abstract class Entity extends Location implements Metadatable{
|
||||
if($this->chunk instanceof FullChunk){
|
||||
$this->chunk->removeEntity($this);
|
||||
}
|
||||
if(($level = $this->level) instanceof Level){
|
||||
$level->removeEntity($this);
|
||||
if($this->level instanceof Level){
|
||||
$this->level->removeEntity($this);
|
||||
}
|
||||
$this->despawnFromAll();
|
||||
$this->level = null;
|
||||
|
||||
@@ -226,4 +226,15 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
return $d;
|
||||
}
|
||||
|
||||
public function close(){
|
||||
if(!$this->closed){
|
||||
var_dump("CLOSED");
|
||||
foreach($this->getInventory()->getViewers() as $player){
|
||||
$this->getInventory()->close($player);
|
||||
}
|
||||
$this->inventory = null;
|
||||
parent::close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user