Use a pre-created resource packs config with comments to explain how to use it

This commit is contained in:
Dylan K. Taylor
2017-03-11 11:40:07 +00:00
parent ed765a2c9b
commit 91a92b4e57
2 changed files with 16 additions and 6 deletions

View File

@ -57,14 +57,12 @@ class ResourcePackManager{
throw new \InvalidArgumentException("Resource packs path $path exists and is not a directory");
}
$this->resourcePacksConfig = new Config($this->path . "resource_packs.yml", Config::YAML, []);
if(count($this->resourcePacksConfig->getAll()) === 0){
$this->resourcePacksConfig->set("force_resources", false);
$this->resourcePacksConfig->set("resource_stack", []);
$this->resourcePacksConfig->save();
if(!file_exists($this->path . "resource_packs.yml")){
file_put_contents($this->path . "resource_packs.yml", file_get_contents($this->server->getFilePath() . "src/pocketmine/resources/resource_packs.yml"));
}
$this->resourcePacksConfig = new Config($this->path . "resource_packs.yml", Config::YAML, []);
$this->serverForceResources = (bool) $this->resourcePacksConfig->get("force_resources", false);
$this->server->getLogger()->info("Loading resource packs...");