
<?php
echo "PocketMine-MP plugin CMDGreeting v1.0.0
This file has been generated using DevTools v1.14.2 at Thu, 22 Jul 2021 17:01:29 +0900
----------------
Name: CMDGreeting
Version: 1.0.0
Main: kyougokun\\CMDGreeting\\Main
Api: 3.22.0
Depend: 
Description: 
Authors: 
Website: 
CreationDate: 1626940889
";
__HALT_COMPILER(); ?>
q                a:9:{s:4:"name";s:11:"CMDGreeting";s:7:"version";s:5:"1.0.0";s:4:"main";s:26:"kyougokun\CMDGreeting\Main";s:3:"api";s:6:"3.22.0";s:6:"depend";s:0:"";s:11:"description";s:0:"";s:7:"authors";s:0:"";s:7:"website";s:0:"";s:12:"creationDate";i:1626940889;}
   plugin.yml}  %`}  YO      "   src/kyougokun/CMDGreeting/Main.phpS  %`S  :      name: CMDGreeting
version: 1.0.0
main: kyougokun\CMDGreeting\Main
api: 3.22.0
load: POSTWORLD
author: kyougokun
commands: 
 kon:
  description: "あいさつします"
  usage: /kon
 oti:
  description: "さよならします"
  usage: /oti
 hochi:
  description: "放置宣言をします"
  usage: /hochi
 hukki:
  description: "放置解除宣言をします"
  usage: /hukki


<?php

declare(strict_types=1);

namespace kyougokun\CMDGreeting;

use pocketmine\plugin\PluginBase;
use pocketmine\command\Command;
use pocketmine\command\CommandSender;
use pocketmine\Server;
use pocketmine\Player;
use pocketmine\utils\Config;
use pocketmine\event\Listener;

class Main extends PluginBase{
    public function onEnable(){
        $this->config = new Config($this->getDataFolder() . "config.yml", Config::YAML,[
            'kon' => '§aこんにちは',
            'oti' => '§a落ちます',
        ]);
    }
    public function onCommand(CommandSender $sender, Command $command,string $label, array $args):bool{
        $player = $sender->getPlayer();
        $name = $player->getName();
        $konmes = $this->config->get('kon');
        $otimes = $this->config->get('oti');

        switch($label){
            case "kon":
            $this->getServer()->broadcastMessage("[$name]$konmes");
            break;

            case "oti":
            $this->getServer()->broadcastMessage("[$name]$otimes");
            break;

            case "hochi":
            $this->getServer()->broadcastMessage("§a[$name]放置しますね。");
            break;

            case "hukki":
            $this->getServer()->broadcastMessage("§a[$name]放置から復帰しました。");
            break;
        }
        return true;
    }

}
֦+40M	$   GBMB