|
30 | 30 |
|
31 | 31 | class DevTools extends PluginBase{ |
32 | 32 |
|
33 | | - public function onLoad(){ |
| 33 | + public function onEnable(){ |
| 34 | + @mkdir($this->getDataFolder()); |
34 | 35 | $this->getServer()->getLoader()->add("FolderPluginLoader", array( |
35 | 36 | $this->getFile() . "src" |
36 | 37 | )); |
37 | | - $this->getServer()->getPluginManager()->registerInterface("FolderPluginLoader\\FolderPluginLoader"); |
38 | | - $this->getServer()->getPluginManager()->loadPlugins($this->getServer()->getPluginPath(), array("FolderPluginLoader\\FolderPluginLoader")); |
39 | | - console("[INFO] Registered folder plugin loader"); |
40 | | - } |
41 | | - |
42 | | - public function onEnable(){ |
43 | | - @mkdir($this->getDataFolder()); |
| 38 | + if(!class_exists("FolderPluginLoader\\FolderPluginLoader", false)){ |
| 39 | + $this->getServer()->getPluginManager()->registerInterface("FolderPluginLoader\\FolderPluginLoader"); |
| 40 | + $this->getServer()->getPluginManager()->loadPlugins($this->getServer()->getPluginPath(), array("FolderPluginLoader\\FolderPluginLoader")); |
| 41 | + console("[INFO] Registered folder plugin loader"); |
| 42 | + } |
44 | 43 | } |
45 | 44 |
|
46 | 45 | public function onCommand(CommandSender $sender, Command $command, $label, array $args){ |
@@ -123,7 +122,7 @@ private function makePluginLoader(CommandSender $sender, Command $command, $labe |
123 | 122 | $phar->setSignatureAlgorithm(\Phar::SHA1); |
124 | 123 | $phar->startBuffering(); |
125 | 124 |
|
126 | | - $phar->addFromString("plugin.yml", "name: FolderPluginLoader\nversion: 1.0.0\nmain: FolderPluginLoader\\Main\napi: [1.0.0]\n"); |
| 125 | + $phar->addFromString("plugin.yml", "name: FolderPluginLoader\nversion: 1.0.0\nmain: FolderPluginLoader\\Main\napi: [1.0.0]\nload: STARTUP\n"); |
127 | 126 | $phar->addFile($this->getFile() . "src/FolderPluginLoader/FolderPluginLoader.php", "src/FolderPluginLoader/FolderPluginLoader.php"); |
128 | 127 | $phar->addFile($this->getFile() . "src/FolderPluginLoader/Main.php", "src/FolderPluginLoader/Main.php"); |
129 | 128 |
|
|
0 commit comments