mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Eliminate more hard dependencies on MainLogger
This commit is contained in:
parent
35eaf38ca1
commit
dce8ed9dd1
@ -1637,7 +1637,7 @@ class Server{
|
||||
|
||||
$this->craftingManager = new CraftingManager();
|
||||
|
||||
$this->resourceManager = new ResourcePackManager($this->getDataPath() . "resource_packs" . DIRECTORY_SEPARATOR);
|
||||
$this->resourceManager = new ResourcePackManager($this->getDataPath() . "resource_packs" . DIRECTORY_SEPARATOR, $this->logger);
|
||||
|
||||
$this->pluginManager = new PluginManager($this, $this->commandMap);
|
||||
$this->pluginManager->subscribeToPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE, $this->consoleSender);
|
||||
|
@ -35,7 +35,6 @@ use pocketmine\permission\Permission;
|
||||
use pocketmine\Server;
|
||||
use pocketmine\timings\Timings;
|
||||
use pocketmine\timings\TimingsHandler;
|
||||
use pocketmine\utils\MainLogger;
|
||||
use pocketmine\utils\Utils;
|
||||
|
||||
/**
|
||||
@ -759,7 +758,7 @@ class PluginManager{
|
||||
$isHandler = count($parameters) === 1 && $parameters[0]->getClass() instanceof \ReflectionClass && is_subclass_of($parameters[0]->getClass()->getName(), Event::class);
|
||||
}catch(\ReflectionException $e){
|
||||
if(isset($tags["softDepend"]) && !isset($this->plugins[$tags["softDepend"]])){
|
||||
MainLogger::getLogger()->debug("Not registering @softDepend listener " . get_class($listener) . "::" . $method->getName() . "(" . $parameters[0]->getType()->getName() . ") because plugin \"" . $tags["softDepend"] . "\" not found");
|
||||
$this->server->getLogger()->debug("Not registering @softDepend listener " . get_class($listener) . "::" . $method->getName() . "(" . $parameters[0]->getType()->getName() . ") because plugin \"" . $tags["softDepend"] . "\" not found");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,6 @@ declare(strict_types=1);
|
||||
namespace pocketmine\resourcepacks;
|
||||
|
||||
use pocketmine\utils\Config;
|
||||
use pocketmine\utils\MainLogger;
|
||||
|
||||
class ResourcePackManager{
|
||||
|
||||
@ -42,13 +41,12 @@ class ResourcePackManager{
|
||||
private $uuidList = [];
|
||||
|
||||
/**
|
||||
* @param string $path Path to resource-packs directory.
|
||||
* @param string $path Path to resource-packs directory.
|
||||
* @param \Logger $logger
|
||||
*/
|
||||
public function __construct(string $path){
|
||||
public function __construct(string $path, \Logger $logger){
|
||||
$this->path = $path;
|
||||
|
||||
$logger = MainLogger::getLogger();
|
||||
|
||||
if(!file_exists($this->path)){
|
||||
$logger->debug("Resource packs path $path does not exist, creating directory");
|
||||
mkdir($this->path);
|
||||
|
Loading…
x
Reference in New Issue
Block a user