
<?php
echo "PocketMine-MP plugin BreakReport v1.0.0
This file has been generated using DevTools v1.13.3 at Mon, 26 Aug 2019 18:34:58 +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:"BreakReport";s:7:"version";s:5:"1.0.0";s:4:"main";s:16:"BreakReport\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:0:"";s:7:"authors";s:0:"";s:7:"website";s:0:"";s:12:"creationDate";i:1566812098;}
   plugin.yml`   §c]`   <         resources/Config.ymlE   §c]E   h/ۇ         src/BreakReport/Main.php  §c]  [вy      #   src/BreakReport/Tasks/WriteTask.php  §c]  o]      name: BreakReport
main: BreakReport\Main
version: 1.0.0
api: [3.0.0,4.0.0]
author: mixpowder---
#例:ReportBlock: ["1:0","0:0","3:0","78:0"]
ReportBlock: []
...
<?php

namespace BreakReport;

use pocketmine\event\Listener;
use pocketmine\utils\Config;
use pocketmine\plugin\PluginBase;
use pocketmine\event\block\BlockBreakEvent;

class Main extends PluginBase implements Listener{

    public function onEnable(){
        $this->getLogger()->info("BreakReportが正常に起動しました。 製作者 mixpowder");
        if(!file_exists($this->getDataFolder())){
            @mkdir($this->getDataFolder(), 0744, true);
        }   
        if(!file_exists($this->getDataFolder()."Config.yml")){
            $this->saveResource("Config.yml");
        }
	$this->getServer()->getPluginManager()->registerEvents($this,$this);
	$this->config = new Config($this->getDataFolder() . "Config.yml", Config::YAML,["ReportBlock" => []]);
        $file = $this->getDataFolder()."Report.txt";
        if(file_exists($file)){
            $this->SizeCheck($file);
        }else{
            touch($file);
            $this->getLogger()->info("§a§lレポートデータファイルが存在しないため作成しました");
        }
    }
    
    public function SizeCheck($file){
        if(filesize($file) > 1048576){
            $this->getLogger()->info("§l§cファイルサイズが1024KBを超えたためレポートデータファイルをリセットしました");
            $fp = fopen($file,"w+");
            fclose($fp);
	}else{
            $filesize = round(filesize($file)/1024,3);
            $this->getLogger()->info("§a§l現在のレポートデータファイルのサイズは{$filesize}KBです");
        }
    }

    public function onBreak(BlockBreakEvent $event){
        $player = $event->getPlayer();
        $block = $event->getBlock();
        $this->getServer()->getAsyncPool()->submitTask(new Tasks\WriteTask($block->getId(),$block->getDamage(),$block->getName(),$player->getName(), $this->config->get("ReportBlock"),$this->getDataFolder()."Report.txt"));
    }
}
<?php

namespace BreakReport\Tasks;

use pocketmine\scheduler\AsyncTask;

class WriteTask extends AsyncTask{
    
    public function __construct($BlockID,$BlockDamage,$BlockName,$PlayerName,$Config,$File){
        $this->BlockID = $BlockID;
        $this->BlockDamage = $BlockDamage;
        $this->BlockName = $BlockName;
        $this->PlayerName = $PlayerName;
        $this->Config = $Config;
        $this->File = $File;
    }

    public function onRun(){
        foreach($this->Config as $blockdata){
            $blockdata = explode(":",$blockdata);
            if($this->BlockID == (int)$blockdata[0] and $this->BlockDamage == (int)$blockdata[1]){
                $fp = fopen($this->File,"a");
                fwrite($fp,date("Y/m/d H:i:s")." block: {$this->BlockName} 破壊者: {$this->PlayerName}\n");
                fclose($fp);
            }
        }
    }
}Slk9j-Y[V   GBMB