Replaced Position->getLevel() null checks with isValid()

This commit is contained in:
Dylan K. Taylor
2018-03-20 11:10:36 +00:00
parent 73e09392b6
commit 1648fff916
7 changed files with 22 additions and 23 deletions

View File

@ -2003,8 +2003,8 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
$this->chunk = null;
}
if($this->getLevel() !== null){
$this->getLevel()->removeEntity($this);
if($this->isValid()){
$this->level->removeEntity($this);
$this->setLevel(null);
}