<?php __HALT_COMPILER(); ?>
l                     src/BlockInCoin/Main.php·  ’_…[·  ç¶B¶      
   plugin.ymla   ’_…[a   ãøuB¶      <?php

namespace BlockInCoin;

use pocketmine\utils\TextFormat;
use pocketmine\plugin\PluginBase;
use pocketmine\utils\Config;
use pocketmine\event\block\BlockBreakEvent;
use pocketmine\event\Listener;
use MixCoinSystem\MixCoinSystem;

class Main extends PluginBase implements Listener {

    public function onEnable() {
        $this->getServer()->getPluginManager()->registerEvents($this,$this);
        $this->getLogger()->info("§aBlockInCoinを読み込みました! by mixpowder");

        if (!file_exists($this->getDataFolder())) {
            @mkdir($this->getDataFolder(), 0744, true);
        }
       $this->random = new Config($this->getDataFolder() . "config.yml", Config::YAML,array(
          '説明' => '確率最小値から確率最大値の間から当てる数字が出たときCoinが増える',
          '説明2' => '例1-10の間からランダムで数字が出るその数字が5だったら1-5の枚数が増える',
          '確率最小値' => '1',
          '確率最大値' => '10',
          '当てる数字' => '5',
          'もらえる数最小値' => '1',
          'もらえる数最大値' => '5',
        ));

        if($this->getServer()->getPluginManager()->getPlugin("MixCoinSystem") == NULL){
          $this->getLogger()->error("MixCoinSystemがありません。入れてきてください");                
          $this->getServer()->shutdown();
        }
      }

    
    public function onBreak(BlockBreakEvent $event){
        $player = $event->getPlayer();
        $name = $player->getName();
        $chance = rand($this->random->get("確率最小値"),$this->random->get("確率最大値"));
        if($chance == $this->random->get("当てる数字")){
        $getcoin = rand($this->random->get("もらえる数最小値"),$this->random->get("もらえる数最大値"));
        MixCoinSystem::getInstance()->PlusCoin($player,$getcoin);
      }
    }
  }
name: BlockInCoin
main: BlockInCoin\Main
version: 1.0.0
api: [3.0.0, 4.0.0]
author: mixpowderƒ8°+F�¯ìÇOEؤ2}¤zhÔ   GBMB