
<?php
echo "PocketMine-MP plugin Repair v1.0.0
This file has been generated using DevTools v1.13.0 at Mon, 18 Feb 2019 21:21:04 +0900
----------------
";

if(extension_loaded("phar")){
	$phar = new \Phar(__FILE__);
	foreach($phar->getMetadata() as $key => $value){
		echo ucfirst($key) . ": " . (is_array($value) ? implode(", ", $value) : $value) . "\n";
	}
}

__HALT_COMPILER(); ?>
~               a:9:{s:4:"name";s:6:"Repair";s:7:"version";s:5:"1.0.0";s:4:"main";s:19:"tatchan\Repair\Main";s:3:"api";s:5:"3.6.0";s:6:"depend";s:0:"";s:11:"description";s:33:"コマンドで修理できるよ";s:7:"authors";s:0:"";s:7:"website";s:0:"";s:12:"creationDate";i:1550492464;}
   plugin.yml1  0j\1  H         src/tatchan/Repair/Main.php  0j\  z}      #Name of your plugin. This is self-explanatory. Plugin names SHOULD NOT contain spaces.
name: Repair

#Fully-qualified class-name of your plugin's main class. This is usually the one that extends PluginBase.
#Since PocketMine-MP's autoloader is PSR-0, your plugin's main-class namespace will usually be the same as the folder path.
main: tatchan\Repair\Main

#Version name/number of your plugin
version: 1.0.0


api: 3.6.0

#When to load the plugin. There are currently two options for this: STARTUP and POSTWORLD. Usually POSTWORLD will do fine.
load: POSTWORLD

#Name of the person who wrote the plugin. This can be anything you like.
author: tatchan

description: "コマンドで修理できるよ"
commands:

 repair:
  #Description to show in the Help command
  description: "コマンドで修理できるよ"
<?php



namespace tatchan\Repair;

use pocketmine\plugin\PluginBase;
use pocketmine\command\CommandSender;
use pocketmine\command\Command;
use pocketmine\Player;
use pocketmine\event\Lisnener;
use pocketmine\item\Armor;
use pocketmine\utils\Config;
use pocketmine\item\Item;
use pocketmine\item\Tool;
use pocketmine\utils\TextFormat;
use pocketmine\utils\Utils;




class Main extends PluginBase{

	public function onEnable() : void{
		$this->getLogger()->info("§d入れてくれてありがとう");
		$this->getLogger()->warning("§amake by tatchan バグ等あったら報告ください");
		$this->EconomyAPI = $this->getServer()->getPluginManager()->getPlugin("EconomyAPI");
		$this->config = new Config($this->getDataFolder() . "config.yml", Config::YAML, array(
'money' => '1000'
));
	}

	public function onCommand(CommandSender $sender, Command $command, string $label, array $args) : bool{
		switch($command->getName()){
			case "repair":
			 if(!$sender instanceof Player){
		        	    $sender->sendMessage("§[ItemRepair]ゲーム内で実行してください");
		        	    break;
		            }
								if($this->config->get("money") >= $this->EconomyAPI->myMoney($sender->getName())){
									$this->EconomyAPI->reduceMoney($sender->getName(), $this->config->get("money"));
									$cm = $this->config->get("money");
									if($money > $cm){
										$sender->sendMessage("§b[ItemRepair]お金が足りません");
                    			break;
									}
				foreach($sender->getInventory()->getContents() as $index => $item){
					if($item->getDamage() > 0){
						$sender->getInventory()->setItem($index, $item->setDamage(0));
						return true;
					}
				}
				}
			}
		}
	public function onDisable() : void{
		$this->getLogger()->info("Bye");
	}
}
I4y2Z6}X{}'   GBMB