mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 17:06:16 +00:00
Position: Destroy references to Level in isValid()
This commit is contained in:
@ -94,7 +94,13 @@ class Position extends Vector3{
|
||||
* @return bool
|
||||
*/
|
||||
public function isValid() : bool{
|
||||
return $this->getLevel() instanceof Level;
|
||||
if($this->level !== null and $this->level->isClosed()){
|
||||
$this->level = null;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->level !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user