<?php echo "Altay plugin NotDoublePlugin v1.0.1\nThis file has been generated using Turanic at Sun, 17 Jun 2018 21:54:55 +0000.\n----------------\n";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(); ?>
             C  a:9:{s:4:"name";s:15:"NotDoublePlugin";s:7:"version";s:5:"1.0.1";s:4:"main";s:20:"NotDoublePlugin\main";s:3:"api";a:2:{i:0;s:5:"3.0.0";i:1;s:13:"3.0.0-ALPHA12";}s:6:"depend";a:0:{}s:11:"description";s:17:"Not Double Click!";s:7:"authors";a:1:{i:0;s:5:"PJZ9n";}s:7:"website";s:8:"asvd.net";s:12:"creationDate";i:1529272495;}
   plugin.yml   &[   K         src/NotDoublePlugin/main.php  &[  jYC      %   src/NotDoublePlugin/EventListener.phpA  &[A  c      name: NotDoublePlugin
main: NotDoublePlugin\main
version: 1.0.1
api: [3.0.0, 3.0.0-ALPHA12]
load: POSTWORLD
author: PJZ9n
description: Not Double Click!
website: asvd.net<?php

    namespace NotDoublePlugin;

    use pocketmine\plugin\PluginBase;
    use pocketmine\utils\Config;

    class main extends PluginBase {

        public function onEnable(): void {
            $this->pluginInit();
            $this->configInit();
            if ($this->checkConfig()) {
                $this->sendInfo();
            } else {
                $this->getServer()->shutdown();
            }
        }

        private function pluginInit(): void {
            $this->getServer()->getPluginManager()->registerEvents(new EventListener($this), $this);
        }

        private function configInit(): void {
            if (!file_exists($this->getDataFolder())) {
                mkdir($this->getDataFolder(), 0700);
            }
            new Config($this->getDataFolder() . "config.yml", Config::YAML, array(
                "Config_Version" => "1.0.0",
                "Block_Level" => "5",
            ));
        }

        private function checkConfig(): bool {
            if ($this->getConfig()->get("Config_Version") !== "1.0.0") {
                $this->getLogger()->critical("Configに記述エラーがあります。");
                $this->getLogger()->critical("エラー：Configバージョンが不正です");
                return false;
            } else if (!ctype_digit($this->getConfig()->get("Block_Level"))) {
                $this->getLogger()->critical("Configに記述エラーがあります。");
                $this->getLogger()->critical("エラー：Block_Levelには数値を指定してください");
                return false;
            } else if ($this->getConfig()->get("Block_Level") < 1) {
                $this->getLogger()->critical("Configに記述エラーがあります。");
                $this->getLogger()->critical("エラー：Block_Levelには正の整数を指定してください");
                return false;
            } else if ($this->getConfig()->get("Block_Level") < 1 || $this->getConfig()->get("Block_Level") > 10) {
                $this->getLogger()->notice("推奨されていない設定で動作しています。");
                $this->getLogger()->notice("Block_Levelの推奨値：1~10 現在のBlock_Levelの設定値：" . $this->getConfig()->get("Block_Level"));
                return true;
            } else {
                return true;
            }
        }

        private function sendInfo(): void {
            $this->getLogger()->info("§e§l" . $this->getDescription()->getName() . "§r§av" . $this->getDescription()->getVersion() . "§r§bを読み込みました！");
            $this->getLogger()->info("§b制作者：" . $this->getDescription()->getAuthors()[0] . ", ウェブサイト：" . $this->getDescription()->getWebsite());
            $this->getLogger()->info("§bライセンス：MIT LICENSE(https://opensource.org/licenses/MIT)");
        }

    }<?php

    namespace NotDoublePlugin;

    use pocketmine\event\Listener;
    use pocketmine\event\player\PlayerInteractEvent;
    use pocketmine\event\server\DataPacketReceiveEvent;
    use pocketmine\network\mcpe\protocol\InventoryTransactionPacket;
    use pocketmine\plugin\Plugin;

    class EventListener implements Listener {

        //Pluginオブジェクトを格納
        private $plugin;
        //データを格納
        private $data;

        public function __construct(Plugin $plugin) {
            $this->plugin = $plugin;
        }

        public function onReceive(DataPacketReceiveEvent $event): void {
            $player = $event->getPlayer();
            $name = $player->getName();
            $packet = $event->getPacket();
            $this_time = ceil(microtime(true) * 1000);
            $comparison = $this->plugin->getConfig()->get("Block_Level") * 100;
            if ($packet instanceof InventoryTransactionPacket) {
                if (!isset($this->data[$name])) {
                    $this->data[$name] = $this_time;
                } else if ($this_time - $this->data[$name] >= $comparison) {
                    $this->data[$name] = $this_time;
                } else {
                    $event->setCancelled();
                }
            }
        }

    }B2
1˭9   GBMB