mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 19:24:12 +00:00
Use a pre-created resource packs config with comments to explain how to use it
This commit is contained in:
@ -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...");
|
||||
|
Reference in New Issue
Block a user