
<?php
echo "PocketMine-MP plugin DustChute v1.0.0
This file has been generated using DevTools v1.13.3 at Sat, 20 Jul 2019 18:35:32 +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:9:"DustChute";s:7:"version";s:5:"1.0.0";s:4:"main";s:34:"Deceitya\DustChute\DustChutePlugin";s:3:"api";s:5:"3.9.0";s:6:"depend";s:0:"";s:11:"description";s:9:"ゴミ箱";s:7:"authors";s:0:"";s:7:"website";s:37:"https://github.com/deceitya/DustChute";s:12:"creationDate";i:1563615332;}   LICENSE-  d2]-  ӵj=      
   plugin.yml  d2]  V      	   README.md   d2]   |n      *   src/Deceitya/DustChute/DustChutePlugin.phps  d2]s  t      MIT License

Copyright (c) 2019 ツキミヤ

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
name: DustChute
main: Deceitya\DustChute\DustChutePlugin
version: 1.0.0
api: 3.9.0

load: POSTWORLD
author: deceitya
description: ゴミ箱
website: https://github.com/deceitya/DustChute

commands:
  dustchute:
    description: ゴミ箱を開く
    usage: "/dustchute"
    permission: dustchute.command.dustchute
permissions:
  dustchute.command.dustchute:
    description: ゴミ箱コマンドが使えます
    default: true# DustChute
ゴミ箱
<?php

namespace Deceitya\DustChute;

use pocketmine\plugin\PluginBase;
use pocketmine\event\Listener;
use pocketmine\command\Command;
use pocketmine\command\CommandSender;
use pocketmine\tile\Chest;
use pocketmine\Player;
use pocketmine\block\Block;
use pocketmine\event\inventory\InventoryCloseEvent;

class DustChutePlugin extends PluginBase implements Listener
{
    private $real = [];

    public function onEnable()
    {
        $this->getServer()->getPluginManager()->registerEvents($this, $this);
    }

    public function onCommand(CommandSender $sender, Command $command, string $label, array $args): bool
    {
        if (!($sender instanceof Player)) {
            $sender->sendMessage("[DustChute] プレイヤーのみ使えるコマンドです。");
            return true;
        }

        $x = (int) $sender->x;
        $y = (int) $sender->y + 2;
        $z = (int) $sender->z;

        $this->real[$sender->getName()] = [$x, $y, $z];

        $block = Block::get(Block::CHEST);
        $block->setComponents($x, $y, $z);
        $sender->level->sendBlocks([$sender], [$block]);

        $nbt = Chest::createNBT($block);
        $nbt->setString("CustomName", "ゴミ箱");
        $chest = Chest::createTile(Chest::CHEST, $sender->level, $nbt);
        $sender->addWindow(new FakeInventory($chest));

        return true;
    }

    public function onClose(InventoryCloseEvent $event)
    {
        if ($event->getInventory() instanceof FakeInventory) {
            $player = $event->getplayer();
            $name = $player->getName();
            if (isset($this->real[$name])) {
                $pos = $this->real[$name];
                $player->level->sendBlocks([$player], [$player->level->getBlockAt($pos[0], $pos[1], $pos[2])]);
                unset($this->real[$name]);
            }
        }
    }
}

class FakeInventory extends \pocketmine\inventory\ChestInventory
{
}
(&-Ttʬ   GBMB