
<?php
echo "PocketMine-MP plugin NBRT v1.0.0
This file has been generated using DevTools v1.13.0 at Thu, 11 Jul 2019 22:59:56 +0930
----------------
";

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(); ?>
r               a:9:{s:4:"name";s:4:"NBRT";s:7:"version";s:5:"1.0.0";s:4:"main";s:17:"tatchan\NBRT\Main";s:3:"api";s:5:"3.8.5";s:6:"depend";s:0:"";s:11:"description";s:27:"資源荒らしを無くす";s:7:"authors";s:0:"";s:7:"website";s:0:"";s:12:"creationDate";i:1562851796;}
   plugin.yml3  9']3  z%         src/tatchan/NBRT/Main.php  9']  H      #Name of your plugin. This is self-explanatory. Plugin names SHOULD NOT contain spaces.
name: NBRT

#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\NBRT\Main

#Version name/number of your plugin
version: 1.0.0

#API version that your plugin supports. If your plugin's API is not compatible with that of the server, the server will refuse to load your plugin.
#The API version is changed when:
# - Breaking changes are made to a development version, things that might cause your plugin to crash.
#     This is denoted by an API suffix, for example 3.0.0-ALPHA4. If the version does not match as a whole on a development version, the plugin will not be loaded. (Suffixes are non-case-sensitive.)
# - Breaking changes are made to a release version, things that might cause your plugin to crash.
#     This usually warrants a major API bump, e.g. 2.0.0 -> 3.0.0. If the major version does not match, the plugin will not be loaded.
# - Feature additions which do not break existing plugins.
#     This is denoted by a minor API bump, e.g. 2.0.0 -> 2.1.0. The server will load plugins with an equivalent or older minor version.
# - Minor bug fixes or insignificant alterations to the API.
#     This is denoted by a patch bump, e.g. 1.13.0 -> 1.13.1
api: 3.8.5

#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

#Simple description of what the plugin is or does. Try to keep this short.
description: 資源荒らしを無くす

#Website for your plugin. This could be a GitHub repository URL, a website of your own, or anything you like. This is optional.

#Commands that your plugin has. You can capture the execution of these via the `onCommand()` method in your PluginBase, or the registered CommandExecutor for the command.
<?php


namespace tatchan\NBRT;

use pocketmine\plugin\PluginBase;
use pocketmine\event\Listener;
use pocketmine\event\Block\BlockBreakEvent;
use pocketmine\level\Level;
use pocketmine\block\Block;
use pocketmine\math\Vector3;
use pocketmine\math\Vector;
use pocketmine\utils\Config;

class Main extends PluginBase implements Listener{


	public function onEnable() : void{
		$this->config = new Config($this->getDataFolder() . "config.yml", Config::YAML, array(
'worldname' => '',
'p' => 'false',
));
		 if($this->config->get("p") == false){
        $this->config->set("p",true);
        $this->config->save();
        $this->getLogger()->notice("§e初めて導入してくれた人へワールド名をconfigに入れてね");
        }
		$this->getServer()->getPluginManager()->registerEvents($this, $this);
		$this->getLogger()->notice("§fNBRTを起動したよ");
		$this->getLogger()->notice("§6製作者:たっちゃん(Cookiettatchan)");
	}

	public function onBreak(BlockBreakEvent $event){
		if(!$this->getServer()->getLevelByName($this->config->get("worldname")) == null){
		$player = $event->getPlayer();
		$block = $event->getBlock();
		$id = $block->getID();
		$x = $block->getX();
		$y = $block->getY() + 1;
		$z = $block->getZ();
		$level = $this->getServer()->getLevelByName($this->config->get("worldname"));
		$vector = new Vector3($x,$y,$z);
		$hbock = $level->getBlock($vector);
		$bid = $hbock->getID();

		if($id == $bid){
			$event->setCancelled();
			$player->sendMessage("§c上にブロックがあるのため掘れません");
}
}else{
	$this->getLogger()->notice("§a⚠ワールド名が正しくないです⚠");
}
}

	public function onDisable() : void{
		$this->getLogger()->info("Bye");
	}
}
g>\:,*4r   GBMB