mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
Added "extensions" attribute in plugin.yml with version checking (#903)
* Added "extensions" attribute in plugin.yml with version checking * Renamed getExtensions() to getRequiredExtensions() As per recommendation from @dktapps
This commit is contained in:
@ -147,6 +147,13 @@ class PluginManager{
|
||||
if(preg_match($loader->getPluginFilters(), basename($path)) > 0){
|
||||
$description = $loader->getPluginDescription($path);
|
||||
if($description instanceof PluginDescription){
|
||||
try{
|
||||
$description->checkRequiredExtensions();
|
||||
}catch(PluginException $ex){
|
||||
$this->server->getLogger()->error($ex->getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
if(($plugin = $loader->loadPlugin($path)) instanceof Plugin){
|
||||
$this->plugins[$plugin->getDescription()->getName()] = $plugin;
|
||||
|
||||
|
Reference in New Issue
Block a user