mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 15:05:33 +00:00
Server: more elegant isLevelGenerated() check
This commit is contained in:
parent
39d1196e4c
commit
bb286dea91
@ -1142,9 +1142,7 @@ class Server{
|
|||||||
}
|
}
|
||||||
$path = $this->getDataPath() . "worlds/" . $name . "/";
|
$path = $this->getDataPath() . "worlds/" . $name . "/";
|
||||||
if(!($this->getLevelByName($name) instanceof Level)){
|
if(!($this->getLevelByName($name) instanceof Level)){
|
||||||
return is_dir($path) and !empty(array_filter(scandir($path, SCANDIR_SORT_NONE), function($v){
|
return !empty(LevelProviderManager::getMatchingProviders($path));
|
||||||
return $v !== ".." and $v !== ".";
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user