Exemplo n.º 1
0
 public function onEnable()
 {
     if (\pocketmine\DEBUG <= 1) {
         return;
     }
     echo __METHOD__ . "," . __LINE__ . "\n";
     //##DEBUG
     // Create example folders
     if (!is_dir($this->getDataFolder())) {
         mkdir($this->getDataFolder());
     }
     $mft = explode("\n", trim($this->getResourceContents("manifest.txt")));
     foreach ($mft as $f) {
         if (file_exists($this->getDataFolder() . $f)) {
             continue;
         }
         $txt = $this->getResourceContents("examples/" . $f);
         file_put_contents($this->getDataFolder() . $f, $txt);
     }
     echo __METHOD__ . "," . __LINE__ . "\n";
     //##DEBUG
     mc::plugin_init($this, $this->getFile());
     MPMU::addCommand($this, $this, "libcommon", ["description" => "LibCommon Command Line interface", "usage" => "/libcommon <subcommand> [options]", "aliases" => ["lc"], "permission" => "libcommon.debug.command"]);
     $this->modules = [];
     foreach (["Version", "DumpMsgs"] as $mod) {
         echo __METHOD__ . "," . __LINE__ . " - {$mod}\n";
         //##DEBUG
         $mod = __NAMESPACE__ . "\\" . $mod;
         $this->modules[] = new $mod($this);
     }
     $this->modules[] = new BasicHelp($this);
 }
Exemplo n.º 2
0
 public function onEnable()
 {
     $this->kr = $this->getServer()->getPluginManager()->getPlugin("KillRate");
     if (!$this->kr || intval($this->kr->getDescription()->getVersion()) != 2) {
         $this->getLogger()->error(TextFormat::RED . "Unable to find KillRate");
         throw new \RuntimeException("Missinge Dependancy");
         return;
     }
     $this->pp = $this->getServer()->getPluginManager()->getPlugin("PurePerms");
     if (!$this->pp) {
         $this->getLogger()->error(TextFormat::RED . "Unable to find PurePerms");
         throw new \RuntimeException("Missinge Dependancy");
         return;
     }
     MPMU::addCommand($this, $this, "krgive", ["description" => "Add points to KillRate score", "usage" => "/krgive <player> <points>"]);
     $this->getServer()->getPluginManager()->registerEvents($this, $this);
 }
Exemplo n.º 3
0
 public function onEnable()
 {
     MPMU::rmCommand($this->getServer(), "give");
     MPMU::addCommand($this, $this, "give", ["description" => "Give stuff", "usage" => "/gift [player] [object:meta] [amount]"]);
 }
Exemplo n.º 4
0
 public function onEnable()
 {
     MPMU::addCommand($this, $this, "sp", ["description" => "Sends popup to player", "usage" => "/sp <player> [message]"]);
     MPMU::addCommand($this, $this, "st", ["description" => "Sends tip to player", "usage" => "/st <player> [message]"]);
     MPMU::addCommand($this, $this, "ss", ["description" => "Serialize", "usage" => "/ss"]);
 }
Exemplo n.º 5
0
 public function onEnable()
 {
     MPMU::rmCommand($this->getServer(), "list");
     MPMU::addCommand($this, $this, "list", ["description" => "Replaced List command", "usage" => "/list"]);
 }