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...");

View File

@ -0,0 +1,12 @@
#This configuration file controls global resources used on your PocketMine-MP server.
#Choose whether players must use your chosen resource packs to join the server.
#NOTE: This will do nothing if there are no resource packs in the stack below.
force_resources: false
resource_stack:
#Resource packs here are applied from bottom to top. This means that resources in higher packs will override those in lower packs.
#Entries here must indicate the filename of the resource pack.
#Example
# - natural.zip
# - vanilla.zip
#If you want to force clients to use vanilla resources, you must place a vanilla resource pack in your resources folder and add it to the stack here.