
<?php
echo "PocketMine-MP plugin BodyCD v1.0.0
This file has been generated using DevTools v1.13.5 at Sat, 01 Feb 2020 23:36:14 +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:6:"BodyCD";s:7:"version";s:5:"1.0.0";s:4:"main";s:20:"Deceitya\BodyCD\Main";s:3:"api";s:6:"3.11.1";s:6:"depend";s:0:"";s:11:"description";s:39:"プレイヤー同士の当たり判定";s:7:"authors";s:0:"";s:7:"website";s:0:"";s:12:"creationDate";i:1580567774;}   LICENSE-  ތ5^-  m/      	   README.md1   ތ5^1   q.w      
   plugin.yml   ތ5^   en         src/Deceitya/BodyCD/Main.php  ތ5^  \z      MIT License

Copyright (c) 2020 ツキミヤ

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.
# BodyCD
プレイヤー同士の当たり判定
name: BodyCD
main: Deceitya\BodyCD\Main
version: 1.0.0
api: 3.11.1
load: POSTWORLD
author: deceitya
description: プレイヤー同士の当たり判定<?php
namespace Deceitya\BodyCD;

use pocketmine\plugin\PluginBase;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerMoveEvent;
use pocketmine\Player;

class Main extends PluginBase implements Listener
{
    public function onEnable()
    {
        $this->getServer()->getPluginManager()->registerEvents($this, $this);
    }

    public function collisionDetection(PlayerMoveEvent $event)
    {
        $player = $event->getPlayer();
        // プレイヤーのAABB内にいるEntityたち↓
        foreach ($player->level->getNearbyEntities($player->getBoundingBox(), $player) as $entity) {
            // $entityがPlayerの場合
            if ($entity instanceof Player) {
                // (終点($entity) - 始点($player))のベクトルを$entityに与える。申し訳程度の微調整で3で割ってます。
                $entity->setMotion($entity->subtract($player->x, $player->y, $player->z)->divide(3.0));
            }
        }
    }
}
Ŗt6   GBMB