mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 10:19:39 +00:00
Use a pre-created resource packs config with comments to explain how to use it
This commit is contained in:
parent
ed765a2c9b
commit
91a92b4e57
@ -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...");
|
||||
|
12
src/pocketmine/resources/resource_packs.yml
Normal file
12
src/pocketmine/resources/resource_packs.yml
Normal 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.
|
Loading…
x
Reference in New Issue
Block a user