Skip to content
This repository has been archived by the owner on Jan 9, 2018. It is now read-only.

Commit

Permalink
v1.4.1 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
shoghicp committed Apr 3, 2014
1 parent 45c47da commit 2ccd6f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
17 changes: 8 additions & 9 deletions src/DevTools/DevTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,16 @@

class DevTools extends PluginBase{

public function onLoad(){
public function onEnable(){
@mkdir($this->getDataFolder());
$this->getServer()->getLoader()->add("FolderPluginLoader", array(
$this->getFile() . "src"
));
$this->getServer()->getPluginManager()->registerInterface("FolderPluginLoader\\FolderPluginLoader");
$this->getServer()->getPluginManager()->loadPlugins($this->getServer()->getPluginPath(), array("FolderPluginLoader\\FolderPluginLoader"));
console("[INFO] Registered folder plugin loader");
}

public function onEnable(){
@mkdir($this->getDataFolder());
if(!class_exists("FolderPluginLoader\\FolderPluginLoader", false)){
$this->getServer()->getPluginManager()->registerInterface("FolderPluginLoader\\FolderPluginLoader");
$this->getServer()->getPluginManager()->loadPlugins($this->getServer()->getPluginPath(), array("FolderPluginLoader\\FolderPluginLoader"));
console("[INFO] Registered folder plugin loader");
}
}

public function onCommand(CommandSender $sender, Command $command, $label, array $args){
Expand Down Expand Up @@ -123,7 +122,7 @@ private function makePluginLoader(CommandSender $sender, Command $command, $labe
$phar->setSignatureAlgorithm(\Phar::SHA1);
$phar->startBuffering();

$phar->addFromString("plugin.yml", "name: FolderPluginLoader\nversion: 1.0.0\nmain: FolderPluginLoader\\Main\napi: [1.0.0]\n");
$phar->addFromString("plugin.yml", "name: FolderPluginLoader\nversion: 1.0.0\nmain: FolderPluginLoader\\Main\napi: [1.0.0]\nload: STARTUP\n");
$phar->addFile($this->getFile() . "src/FolderPluginLoader/FolderPluginLoader.php", "src/FolderPluginLoader/FolderPluginLoader.php");
$phar->addFile($this->getFile() . "src/FolderPluginLoader/Main.php", "src/FolderPluginLoader/Main.php");

Expand Down
7 changes: 6 additions & 1 deletion src/FolderPluginLoader/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@
namespace FolderPluginLoader;

use pocketmine\plugin\PluginBase;
use pocketmine\plugin\PluginLoadOrder;

class Main extends PluginBase{

public function onLoad(){

}

public function onEnable(){
$this->getServer()->getPluginManager()->registerInterface("FolderPluginLoader\\FolderPluginLoader");
$this->getServer()->getPluginManager()->loadPlugins($this->getServer()->getPluginPath(), array("FolderPluginLoader\\FolderPluginLoader"));
console("[INFO] Registered folder plugin loader");
$this->getServer()->enablePlugins(PluginLoadOrder::STARTUP);
}
}

0 comments on commit 2ccd6f2

Please sign in to comment.