Server: more elegant isLevelGenerated() check

This commit is contained in:
Dylan K. Taylor 2018-10-13 15:37:26 +01:00
parent 39d1196e4c
commit bb286dea91

View File

@ -1142,9 +1142,7 @@ class Server{
}
$path = $this->getDataPath() . "worlds/" . $name . "/";
if(!($this->getLevelByName($name) instanceof Level)){
return is_dir($path) and !empty(array_filter(scandir($path, SCANDIR_SORT_NONE), function($v){
return $v !== ".." and $v !== ".";
}));
return !empty(LevelProviderManager::getMatchingProviders($path));
}
return true;