A plugin that will load other plugins that are listed in a configuration file. However, these "other plugins" are in a different folder that is located outside of the main Pocketmine server folder structure. Because of this, the plugin dataFolder must be altered to match the default location for the server (/plugins/PluginName/) or the other loaded plugins will not work properly and the server owner will not be able to alter the config files for the loaded "other plugins". I've already written this for Spigot and it works perfectly. However, changing the data folder was a challenge for me. I had to hire an expert for the solution, which was to use reflection to change the data folder attribute. (Oh sure, it looks simple now!) I'm not quite sure how to do the same thing in PHP. While I'm quite familiar with PHP (old school), I'm quite unfamiliar with OOP, especially as it relates to Pocketmine. Suggestions are much appreciated. Happy to compensate someone for their consulting time to bring me up to speed on Pocketmine OOP. I've been checking out other plugins for ideas, but almost all of them are created for doing something after the server is loaded and running. I have not been able to locate examples of interfacing directly with PluginManager like I've done in Spigot: Code: Plugin plugin = pluginManager.loadPlugin(pluginJar); setDataFolder(plugin,newDataFolder); // This calls a function that uses reflection to change the dataFolder attribute. plugin.onLoad(); pluginManager.enablePlugin(plugin);
Saving data folders in the source folder containing the plugin is a legacy thing. Delete legacy data directories in pocketmine.yml so that plugin data are stored in a specific plugin_data directory.
Thanks, SOFe. It appears PMMP properly uses the new data folder, even when the plugin is loaded from a non-standard folder. Using reflection wasn't required after all. This is an interesting article about using (abusing) some other ways to read & write private class data: https://www.lambda-out-loud.com/posts/accessing-private-properties-php/