
<?php
echo "PocketMine-MP plugin nodrop v0.0.1
This file has been generated using DevTools v1.13.4 at Sat, 09 May 2020 18:37:21 +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(); ?>
×             E  a:9:{s:4:"name";s:6:"nodrop";s:7:"version";s:5:"0.0.1";s:4:"main";s:19:"tatchan\nodrop\Main";s:3:"api";s:6:"3.11.8";s:6:"depend";s:0:"";s:11:"description";s:48:"特定のアイテムをドロップさせない";s:7:"authors";s:0:"";s:7:"website";s:37:"https://github.com/TATCHAN0825/NoDrop";s:12:"creationDate";i:1589017041;}   LICENSE·  Ñy¶^·  vqÀ¨¶      
   plugin.ymlÐ  Ñy¶^Ð  a襣¶         src/tatchan/nodrop/Main.phpë	  Ñy¶^ë	  ;›O5¶      NYSL Version 0.9982
----------------------------------------

A. 本ソフトウェアは Everyone'sWare です。このソフトを手にした一人一人が、
   ご自分の作ったものを扱うのと同じように、自由に利用することが出来ます。

  A-1. フリーウェアです。作者からは使用料等を要求しません。
  A-2. 有料無料や媒体の如何を問わず、自由に転載・再配布できます。
  A-3. いかなる種類の 改変・他プログラムでの利用 を行っても構いません。
  A-4. 変更したものや部分的に使用したものは、あなたのものになります。
       公開する場合は、あなたの名前の下で行って下さい。

B. このソフトを利用することによって生じた損害等について、作者は
   責任を負わないものとします。各自の責任においてご利用下さい。

C. 著作者人格権は tatchan に帰属します。著作権は放棄します。

D. 以上の３項は、ソース・実行バイナリの双方に適用されます。



NYSL Version 0.9982 (en) (Unofficial)
----------------------------------------
A. This software is "Everyone'sWare". It means:
  Anybody who has this software can use it as if he/she is
  the author.

  A-1. Freeware. No fee is required.
  A-2. You can freely redistribute this software.
  A-3. You can freely modify this software. And the source
      may be used in any software with no limitation.
  A-4. When you release a modified version to public, you
      must publish it with your name.

B. The author is not responsible for any kind of damages or loss
  while using or misusing this software, which is distributed
  "AS IS". No warranty of any kind is expressed or implied.
  You use AT YOUR OWN RISK.

C. Copyrighted to (tatchan)

D. Above three clauses are applied both to source and binary
  form of this software.#Name of your plugin. This is self-explanatory. Plugin names SHOULD NOT contain spaces.
name: nodrop

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

#Version name/number of your plugin
version: 0.0.1

#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.11.8

#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.
website: https://github.com/TATCHAN0825/NoDrop

#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.
#This node is optional and can be removed if your plugin will not have any commands.<?php

declare(strict_types=1);

namespace tatchan\nodrop;

use pocketmine\event\Listener;
use pocketmine\event\player\PlayerDropItemEvent;
use pocketmine\plugin\PluginBase;
use pocketmine\command\CommandSender;
use pocketmine\command\Command;
use pocketmine\event\Player\PlayerDataSaveEvent;
use pocketmine\utils\Config;
use pocketmine\event\block\BlockPlaceEvent;
use pocketmine\event\inventory\CraftItemEvent;
use pocketmine\event\inventory\InventoryTransactionEvent;
use pocketmine\event\inventory\FurnaceBurnEvent;
use pocketmine\item\Item;
use pocketmine\event\inventory\CraftingManager;
class Main extends PluginBase implements Listener{

    public function onEnable(): void{
        $this->getServer()->getPluginManager()->registerEvents($this, $this);
        $this->config = new Config($this->getDataFolder() . "config.yml", Config::YAML);
    }

    public function ondrop(PlayerDropItemEvent $event){
        $id = $event->getItem()->getId();
        $damage = $event->getItem()->getDamage();
        if ($this->config->exists("{$id}:{$damage}")) {
            $event->getPlayer()->sendMessage("§c>>§fこのアイテムのドロップは禁止されてます");
            $event->setCancelled();
        }
    }

    public function oncraft(CraftItemEvent $event){
        $id = $event->getInputs();
        foreach ($id as $item) {
            $id = $item->getId();
            $damage = $item->getDamage();
            if ($this->config->exists("{$id}:{$damage}")) {
                $event->getPlayer()->sendMessage("§c>>§fこのアイテムのクラフトは禁止されてます");
                $event->setCancelled();
            }
        }
    }

    public function onplace(BlockPlaceEvent $event){
        $id = $event->getItem()->getId();
        $damage = $event->getItem()->getDamage();
        if ($this->config->exists("{$id}:{$damage}")) {
            $event->getPlayer()->sendMessage("§c>>§fこのアイテムの設置は禁止されてます");
            $event->setCancelled();
        }
    }

    public function onchest(InventoryTransactionEvent $event){
        foreach ($event->getTransaction()->getActions() as $act) {

            if ($this->getConfig()->exists("{$act->getTargetItem()->getID()}:{$act->getTargetItem()->getDamage()}")) {
                $event->setCancelled();
                $event->getTransaction()->getSource()->getPlayer()->sendMessage("§c>>§fこのアイテムの精錬、チェストに預けるのは禁止されています");
            }
        }
    }
}

2Š9o1 a½ë!¦÷“]¸   GBMB