mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Position: Destroy references to Level in isValid()
This commit is contained in:
parent
403e996d2f
commit
8d645b714f
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user