mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 00:29:54 +00:00
Added dependency search on loaded plugins
This commit is contained in:
parent
febc6af323
commit
ab1fbae2f2
@ -255,7 +255,7 @@ class PluginManager{
|
|||||||
foreach($plugins as $name => $file){
|
foreach($plugins as $name => $file){
|
||||||
if(isset($dependencies[$name])){
|
if(isset($dependencies[$name])){
|
||||||
foreach($dependencies[$name] as $key => $dependency){
|
foreach($dependencies[$name] as $key => $dependency){
|
||||||
if(isset($loadedPlugins[$dependency])){
|
if(isset($loadedPlugins[$dependency]) or $this->getPlugin($dependency) instanceof Plugin){
|
||||||
unset($dependencies[$name][$key]);
|
unset($dependencies[$name][$key]);
|
||||||
}elseif(!isset($plugins[$dependency])){
|
}elseif(!isset($plugins[$dependency])){
|
||||||
console("[SEVERE] Could not load plugin '" . $name . "': Unknown dependency");
|
console("[SEVERE] Could not load plugin '" . $name . "': Unknown dependency");
|
||||||
@ -270,7 +270,7 @@ class PluginManager{
|
|||||||
|
|
||||||
if(isset($softDependencies[$name])){
|
if(isset($softDependencies[$name])){
|
||||||
foreach($softDependencies[$name] as $key => $dependency){
|
foreach($softDependencies[$name] as $key => $dependency){
|
||||||
if(isset($loadedPlugins[$dependency])){
|
if(isset($loadedPlugins[$dependency]) or $this->getPlugin($dependency) instanceof Plugin){
|
||||||
unset($softDependencies[$name][$key]);
|
unset($softDependencies[$name][$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
28
src/pocketmine/utils/MonkeyPatch.php
Normal file
28
src/pocketmine/utils/MonkeyPatch.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* @author PocketMine Team
|
||||||
|
* @link http://www.pocketmine.net/
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace pocketmine\utils;
|
||||||
|
|
||||||
|
class MonkeyPatch{
|
||||||
|
public function __construct(){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
31
src/pocketmine/utils/Patchable.php
Normal file
31
src/pocketmine/utils/Patchable.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* @author PocketMine Team
|
||||||
|
* @link http://www.pocketmine.net/
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace pocketmine\utils;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All classes or interfaces (including plugins) that want to be able to be patched in runtime
|
||||||
|
* need to implement this interface
|
||||||
|
*/
|
||||||
|
interface Patchable{
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user