From 73d3f9f7f7684da34befd2fb2a4e4166f04d7f02 Mon Sep 17 00:00:00 2001 From: TheNewHEROBRINEX Date: Wed, 17 Jul 2019 17:52:29 +0200 Subject: [PATCH] Fix loadbefore sometimes not working (#3040) loadbefore operates by injecting self into the target plugin's soft-dependencies. The problem is that these soft-dependency lists are overwritten if the target plugin's soft-dependencies are resolved after the loadbefore of the origin plugin. --- src/pocketmine/plugin/PluginManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/plugin/PluginManager.php b/src/pocketmine/plugin/PluginManager.php index 0034dc93a..7936542fd 100644 --- a/src/pocketmine/plugin/PluginManager.php +++ b/src/pocketmine/plugin/PluginManager.php @@ -286,7 +286,7 @@ class PluginManager{ $plugins[$name] = $file; - $softDependencies[$name] = $description->getSoftDepend(); + $softDependencies[$name] = array_merge($softDependencies[$name] ?? [], $description->getSoftDepend()); $dependencies[$name] = $description->getDepend(); foreach($description->getLoadBefore() as $before){