ResourcePackManager: Remove redundant config property

This was only used in the constructor, there's no need to store it.
This commit is contained in:
Dylan K. Taylor 2017-12-22 11:05:47 +00:00
parent 3a4f79629c
commit 8f811c29d7

View File

@ -36,9 +36,6 @@ class ResourcePackManager{
/** @var string */ /** @var string */
private $path; private $path;
/** @var Config */
private $resourcePacksConfig;
/** @var bool */ /** @var bool */
private $serverForceResources = false; private $serverForceResources = false;
@ -67,13 +64,13 @@ class ResourcePackManager{
copy(\pocketmine\RESOURCE_PATH . "resource_packs.yml", $this->path . "resource_packs.yml"); copy(\pocketmine\RESOURCE_PATH . "resource_packs.yml", $this->path . "resource_packs.yml");
} }
$this->resourcePacksConfig = new Config($this->path . "resource_packs.yml", Config::YAML, []); $resourcePacksConfig = new Config($this->path . "resource_packs.yml", Config::YAML, []);
$this->serverForceResources = (bool) $this->resourcePacksConfig->get("force_resources", false); $this->serverForceResources = (bool) $resourcePacksConfig->get("force_resources", false);
$this->server->getLogger()->info("Loading resource packs..."); $this->server->getLogger()->info("Loading resource packs...");
foreach($this->resourcePacksConfig->get("resource_stack", []) as $pos => $pack){ foreach($resourcePacksConfig->get("resource_stack", []) as $pos => $pack){
try{ try{
$packPath = $this->path . DIRECTORY_SEPARATOR . $pack; $packPath = $this->path . DIRECTORY_SEPARATOR . $pack;
if(file_exists($packPath)){ if(file_exists($packPath)){