mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-16 08:25:29 +00:00
parent
215da7e3f4
commit
6b5ff5016e
@ -41,12 +41,9 @@ class FolderPluginLoader implements PluginLoader{
|
||||
/**
|
||||
* Loads the plugin contained in $file
|
||||
*/
|
||||
public function loadPlugin(string $path) : void{
|
||||
$description = $this->getPluginDescription($path);
|
||||
if($description !== null){
|
||||
public function loadPlugin(string $path, PluginDescription $description) : void{
|
||||
$this->loader->addPath($description->getSrcNamespacePrefix(), "$path/src");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the PluginDescription from the file
|
||||
|
@ -42,12 +42,9 @@ class PharPluginLoader implements PluginLoader{
|
||||
/**
|
||||
* Loads the plugin contained in $file
|
||||
*/
|
||||
public function loadPlugin(string $path) : void{
|
||||
$description = $this->getPluginDescription($path);
|
||||
if($description !== null){
|
||||
public function loadPlugin(string $path, PluginDescription $description) : void{
|
||||
$this->loader->addPath($description->getSrcNamespacePrefix(), "$path/src");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the PluginDescription from the file
|
||||
|
@ -36,7 +36,7 @@ interface PluginLoader{
|
||||
/**
|
||||
* Loads the plugin contained in $file
|
||||
*/
|
||||
public function loadPlugin(string $path) : void;
|
||||
public function loadPlugin(string $path, PluginDescription $description) : void;
|
||||
|
||||
/**
|
||||
* Gets the PluginDescription from the file
|
||||
|
@ -150,7 +150,7 @@ class PluginManager{
|
||||
}
|
||||
|
||||
$prefixed = $loader->getAccessProtocol() . $path;
|
||||
$loader->loadPlugin($prefixed);
|
||||
$loader->loadPlugin($prefixed, $description);
|
||||
|
||||
$mainClass = $description->getMain();
|
||||
if(!class_exists($mainClass, true)){
|
||||
|
@ -46,7 +46,7 @@ class ScriptPluginLoader implements PluginLoader{
|
||||
/**
|
||||
* Loads the plugin contained in $file
|
||||
*/
|
||||
public function loadPlugin(string $path) : void{
|
||||
public function loadPlugin(string $path, PluginDescription $description) : void{
|
||||
include_once $path;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user