Returns a LevelProvider class for this path, or null
public static getProvider ( string $path ) : string | ||
$path | string | |
return | string |
/** * @param string $name * * @return bool */ public function isLevelGenerated($name) { if (trim($name) === "") { return false; } $path = $this->getDataPath() . "worlds/" . $name . "/"; if (!$this->getLevelByName($name) instanceof Level) { if (LevelProviderManager::getProvider($path) === null) { return false; } /*if(file_exists($path)){ $level = new LevelImport($path); if($level->import() === false){ //Try importing a world return false; } }else{ return false; }*/ } return true; }
/** * @param string $name * * @return bool */ public function isLevelGenerated($name) { if (trim($name) === "") { return false; } $path = $this->getDataPath() . "worlds/" . $name . "/"; if (!$this->getLevelByName($name) instanceof Level) { if (LevelProviderManager::getProvider($path) === null) { return false; } } return true; }