mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
resource packs: added new option remove_client_resources, fixed client packs being removed when forcing resource pack download
This commit is contained in:
@ -43,6 +43,8 @@ class ResourcePackManager{
|
||||
|
||||
/** @var bool */
|
||||
private $serverForceResources = false;
|
||||
/** @var bool */
|
||||
private $removeClientResourcePacks = false;
|
||||
|
||||
/** @var ResourcePack[] */
|
||||
private $resourcePacks = [];
|
||||
@ -71,6 +73,7 @@ class ResourcePackManager{
|
||||
$resourcePacksConfig = new Config($this->path . "resource_packs.yml", Config::YAML, []);
|
||||
|
||||
$this->serverForceResources = (bool) $resourcePacksConfig->get("force_resources", false);
|
||||
$this->removeClientResourcePacks = (bool) $resourcePacksConfig->get("remove_client_resources", false);
|
||||
|
||||
$logger->info("Loading resource packs...");
|
||||
|
||||
@ -136,6 +139,16 @@ class ResourcePackManager{
|
||||
return $this->serverForceResources;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether client-sided global resources will be removed.
|
||||
* Useful if you want to force vanilla resources.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function removeClientResourcePacks() : bool{
|
||||
return $this->removeClientResourcePacks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of resource packs in use, sorted in order of priority.
|
||||
* @return ResourcePack[]
|
||||
|
Reference in New Issue
Block a user