mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
PluginManager: remove loadPlugin()
loadPlugins() is now the preferred option, since it does all the proper checks. In addition, the server now acknowledges that loading a single plugin may cause multiple plugins to be loaded, so returning only a single Plugin is not representative of what's actually happening.
This commit is contained in:
parent
03fcd844eb
commit
76b4b23d98
@ -175,22 +175,6 @@ class PluginManager{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PluginLoader[] $loaders
|
||||
*/
|
||||
public function loadPlugin(string $path, ?array $loaders = null) : ?Plugin{
|
||||
foreach($loaders ?? $this->fileAssociations as $loader){
|
||||
if($loader->canLoadPlugin($path)){
|
||||
$description = $loader->getPluginDescription($path);
|
||||
if($description instanceof PluginDescription){
|
||||
$this->internalLoadPlugin($path, $loader, $description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private function internalLoadPlugin(string $path, PluginLoader $loader, PluginDescription $description) : ?Plugin{
|
||||
$language = $this->server->getLanguage();
|
||||
$this->server->getLogger()->info($this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_plugin_load($description->getFullName())));
|
||||
|
Loading…
x
Reference in New Issue
Block a user