<?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