
<?php
echo "PocketMine-MP plugin MineCounter v1.0.0
This file has been generated using DevTools v1.13.0 at Fri, 18 Jan 2019 23:03:36 +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:11:"MineCounter";s:7:"version";s:5:"1.0.0";s:4:"main";s:12:"counter\Main";s:3:"api";a:2:{i:0;s:5:"3.0.0";i:1;s:5:"4.0.0";}s:6:"depend";s:0:"";s:11:"description";s:21:"ブロック破壊数";s:7:"authors";s:0:"";s:7:"website";s:0:"";s:12:"creationDate";i:1547820216;}   src/counter/Main.php  A\  Y.k      
   plugin.yml   A\   ʎ      <?php

namespace counter;

use pocketmine\plugin\PluginBase;

use pocketmine\Player;

use pocketmine\event\Listener;
use pocketmine\event\block\BlockBreakEvent;
use pocketmine\event\player\PlayerJoinEvent;

use pocketmine\command\{Command, CommandSender};

use pocketmine\utils\Config;

class Main extends PluginBase implements Listener{
	public function onEnable(){
		$this->getLogger()->info("MineCounterを読み込みました! made by bboyyu51");
		
		if(!file_exists($this->getDataFolder())){
			@mkdir($this->getDataFolder(), 0744, true);
		}
		
		$this->count = new Config($this->getDataFolder(). "count.yml" ,Config::YAML);
		
		$this->getServer()->getPluginManager()->registerEvents($this,$this);
	}
	
	public function addCount(Player $player){
		$name = $player->getName();
		$c = $this->count->get($name);
		$this->count->set($name, ++$c);
		$this->count->save();
	}
	
	public function onJoin(PlayerJoinEvent $event){
		$name = $event->getPlayer()->getName();
		if(!$this->count->exists($name)){
			$this->count->set($name, 0);
			$this->count->save();
		}
	}
	
	public function onBreak(BlockBreakEvent $event){
		$this->addCount($event->getPlayer());
	}
	
	public function onCommand(CommandSender $sender, Command $command, string $label, array $args) :bool{
		switch (strtolower($command->getName())){
			
		case 'cblock':
		
			$count = $this->count->get($sender->getName());
			$sender->sendMessage("§b貴方のブロック破壊数は§l§c".$count."§r§b回です。");
		
		break;
		}
		return true;
	}
}
name: MineCounter
api: [3.0.0,4.0.0]
main: counter\Main
version: 1.0.0
description: ブロック破壊数
author: bboyyu51
commands: 
 cblock: 
  description: ブロック破壊数表示7D	)}qo,s   GBMB