<?php __HALT_COMPILER(); ?>
d                 
   plugin.ymlê      ê   D^\P¶         src/xtakumatutix/               ¶         src/xtakumatutix/noplace/               ¶      *   src/xtakumatutix/noplace/EventListener.phpV     V  `d¶      !   src/xtakumatutix/noplace/Main.php:     :  Éa¶      +   src/xtakumatutix/noplace/noplaceCommand.php_
     _
  sð'F¶      ---
name: noplace
main: xtakumatutix\noplace\Main
version: 1.0.0
api: 3.0.0
premissions:
  noplace:
    description: "置けないブロックを追加します"
    default: op
    usage: /noplace <action> <id:damage>
...
<?php

namespace xtakumatutix\noplace;

use pocketmine\event\Listener;
use pocketmine\event\block\BlockPlaceEvent;
use pocketmine\item\Item;
use pocketmine\utils\Config;

class EventListener implements Listener 
{
    private $Main;

    public function __construct(Main $Main)
    {
        $this->Main = $Main;
    }

    public function onplace(BlockPlaceEvent $event)
    {
        $config = $this->Main->id;
        $player = $event->getPlayer();
        $item = $event->getItem();
        $id = $item->getID();
        $damage = $item->getDamage();
        if(!$player->isOP()){
            if ($config->exists($id.":".$damage)){
        	    $message = $this->Main->config->get('表示メッセージ');
        	    $player->sendMessage($message);
        	    $event->setCancelled();
        	}
        }
    }
}<?php

namespace xtakumatutix\noplace;

use pocketmine\plugin\PluginBase;
use pocketmine\utils\Config;
use xtakumatutix\noplace\EventListener;

Class Main extends PluginBase 
{

    public function onEnable() 
    {
        $this->getLogger()->notice("起動メッセージを送信しました - ver.".$this->getDescription()->getVersion());
        $this->getServer()->getCommandMap()->register("noplace", new noplaceCommand($this));
        $this->getServer()->getPluginManager()->registerEvents(new EventListener($this), $this);
        $this->id = new Config($this->getDataFolder() . "id.yml", Config::YAML,);
        $this->config = new Config($this->getDataFolder() . "config.yml", Config::YAML, [
            '表示メッセージ' => '§cそのブロックは置けません'
        ]);
    }
}<?php

namespace xtakumatutix\noplace;

use pocketmine\plugin\PluginBase;
use pocketmine\Player;
use pocketmine\utils\Config;
use pocketmine\command\Command;
use pocketmine\command\CommandSender;

Class noplaceCommand extends Command 
{
    private $Main;

    public function __construct(Main $Main)
    {
        $this->Main = $Main;
        parent::__construct("noplace", "置けないブロックを追加します", "/noplace");
        $this->setPermission("noplace.command.noplace");
        $this->setDescription("置けないブロックを追加します");
        $this->setUsage("/noplace <id:damage>");
    }

    public function execute(CommandSender $sender, string $commandLabel, array $args): bool
    {
        if($sender->isOP()){
            $id = $this->Main->id;
            if(isset($args[0])){
                switch ($args[0]){
                    case "set":
                    if(isset($args[1])){
                        if(!$id->exists($args[1])){
                            $sender->sendMessage("ID:".$args[1]."を置けないブロックとして登録しました");
                            $id->set($args[1]);
                            $id->save();
                        }else{
                            $sender->sendMessage("そのブロックIDは先に登録されています");
                        }
                    }else{
                        $sender->sendMessage("IDを入力してください");
                        return true;
                    }
                    break;

                    case "remove":
                    if(isset($args[1])){
                        if($id->exists($args[1])){
                            $sender->sendMessage("ID:".$args[1]."を置けるようにしました");
                            $id->remove($args[1]);
                            $id->save();
                        }else{
                            $sender->sendMessage("そのブロックIDは登録されていません");
                        }
                    }else{
                        $sender->sendMessage("IDを入力してください");
                        return true;
                    }
                    break;
                }
            }else{
                $sender->sendMessage("使い方\n/npolace set <id:damage> 置けないブロックを登録する\n/noplace remove <id:damage> 置けなくしたブロックを置けるようにする");
            }
        }else{
            $sender->sendMessage("OPのみ使えます");
        }
        return true;
    }
}C ±üŽ]¯M8©ZŽ:|Ðë¼ùä   GBMB