Fixed crash on tile unloading

This commit is contained in:
Shoghi Cervantes
2014-08-15 16:37:39 +02:00
parent a7b44e3892
commit ec93ed3e3d
2 changed files with 10 additions and 3 deletions

View File

@@ -1048,7 +1048,9 @@ abstract class Entity extends Position implements Metadatable{
if($this->chunk instanceof FullChunk){
$this->chunk->removeEntity($this);
}
$this->getLevel()->removeEntity($this);
if(($level = $this->getLevel()) instanceof Level){
$level->removeEntity($this);
}
$this->despawnFromAll();
$this->level->release();
}