当前位置: 首页>>代码示例>>PHP>>正文


PHP Player::addEntityMotion方法代码示例

本文整理汇总了PHP中pocketmine\Player::addEntityMotion方法的典型用法代码示例。如果您正苦于以下问题:PHP Player::addEntityMotion方法的具体用法?PHP Player::addEntityMotion怎么用?PHP Player::addEntityMotion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pocketmine\Player的用法示例。


在下文中一共展示了Player::addEntityMotion方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkMove

 public function checkMove(Player &$player, $time)
 {
     if ($time - $this->past[$player->getName()] > 400) {
         // stable->450 safe->600
         $x = -\sin($player->yaw / 180 * M_PI) * \cos($player->pitch / 180 * M_PI);
         $y = -\sin($player->pitch / 180 * M_PI);
         $z = \cos($player->yaw / 180 * M_PI) * \cos($player->pitch / 180 * M_PI);
         $player->addEntityMotion(0, $x, $y, $z);
         // echo "c! " . ($time - $this->past [$player->getName ()]) . "\n";
         // echo "n! " . $x . ":" . $y . ":" . $z . "\n";
     }
     $this->past[$player->getName()] = $time;
 }
开发者ID:EmreTr1,项目名称:rtr,代码行数:13,代码来源:StartDASH.php

示例2: spawnTo

 public function spawnTo(Player $player)
 {
     $pk = new AddEntityPacket();
     $pk->type = Arrow::NETWORK_ID;
     $pk->eid = $this->getId();
     $pk->x = $this->x;
     $pk->y = $this->y;
     $pk->z = $this->z;
     $pk->did = 0;
     //TODO: send motion here
     $player->dataPacket($pk);
     $player->addEntityMotion($this->getId(), $this->motionX, $this->motionY, $this->motionZ);
     parent::spawnTo($player);
 }
开发者ID:Edwardthedog2,项目名称:Steadfast2,代码行数:14,代码来源:Arrow.php

示例3: spawnTo

 public function spawnTo(Player $player)
 {
     $pk = new AddEntityPacket();
     $pk->eid = $this->getId();
     $pk->type = Skeleton::NETWORK_ID;
     $pk->x = $this->x;
     $pk->y = $this->y;
     $pk->z = $this->z;
     $pk->yaw = $this->yaw;
     $pk->pitch = $this->pitch;
     $pk->metadata = $this->dataProperties;
     $player->dataPacket($pk);
     $player->addEntityMotion($this->getId(), $this->motionX, $this->motionY, $this->motionZ);
     parent::spawnTo($player);
 }
开发者ID:misha1,项目名称:MyOwnWorld,代码行数:15,代码来源:Skeleton.php

示例4: spawnTo

 public function spawnTo(Player $player)
 {
     echo __METHOD__ . __LINE__ . "\n";
     $pk = new AddEntityPacket();
     $pk->eid = $this->getId();
     $pk->type = Minecart::NETWORK_ID;
     $pk->x = $this->x;
     $pk->y = $this->y;
     $pk->z = $this->z;
     $pk->did = 0;
     //$pk->speedX = $this->motionX;
     //$pk->speedY = $this->motionY;
     //$pk->speedZ = $this->motionZ;
     $player->dataPacket($pk);
     $player->addEntityMotion($this->getId(), $this->motionX, $this->motionY, $this->motionZ);
     parent::spawnTo($player);
 }
开发者ID:AvivShopen,项目名称:bad-plugins,代码行数:17,代码来源:Minecart.php

示例5: spawnTo

 public function spawnTo(Player $player)
 {
     $pk = new AddEntityPacket();
     $pk->eid = $this->getId();
     $pk->type = Blaze::NETWORK_ID;
     $pk->x = $this->x;
     $pk->y = $this->y + 2;
     $pk->z = $this->z;
     $pk->speedX = $this->motionX;
     $pk->speedY = $this->motionY;
     $pk->speedZ = $this->motionZ;
     $pk->yaw = $this->yaw;
     $pk->pitch = $this->pitch;
     $pk->metadata = $this->dataProperties;
     $player->dataPacket($pk->setChannel(Network::CHANNEL_ENTITY_SPAWNING));
     $player->addEntityMotion($this->getId(), $this->motionX, $this->motionY, $this->motionZ);
     parent::spawnTo($player);
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:18,代码来源:Blaze.php

示例6: spawnTo

 public function spawnTo(Player $player)
 {
     $pk = new AddEntityPacket();
     $pk->type = FallingSand::NETWORK_ID;
     $pk->eid = $this->getId();
     $pk->x = $this->x;
     $pk->y = $this->y;
     $pk->z = $this->z;
     $pk->did = -($this->getBlock() | $this->getDamage() << 0x10);
     $player->dataPacket($pk);
     $player->addEntityMotion($this->getId(), $this->motionX, $this->motionY, $this->motionZ);
     parent::spawnTo($player);
 }
开发者ID:hlogeon,项目名称:PocketMineJs-MP,代码行数:13,代码来源:FallingSand.php

示例7: spawnTo

 public function spawnTo(Player $player)
 {
     if ($player !== $this and !isset($this->hasSpawned[$player->getId()])) {
         $this->hasSpawned[$player->getId()] = $player;
         $pk = new AddPlayerPacket();
         $pk->clientID = 0;
         if ($player->getRemoveFormat()) {
             $pk->username = TextFormat::clean($this->nameTag);
         } else {
             $pk->username = $this->nameTag;
         }
         $pk->eid = $this->getId();
         $pk->x = $this->x;
         $pk->y = $this->y;
         $pk->z = $this->z;
         $pk->yaw = $this->yaw;
         $pk->pitch = $this->pitch;
         $item = $this->getInventory()->getItemInHand();
         $pk->item = $item->getId();
         $pk->meta = $item->getDamage();
         $pk->metadata = $this->getData();
         $player->dataPacket($pk);
         $player->addEntityMotion($this->getId(), $this->motionX, $this->motionY, $this->motionZ);
         $this->inventory->sendArmorContents($player);
     }
 }
开发者ID:rryy,项目名称:PocketMine-MP,代码行数:26,代码来源:Human.php

示例8: spawnTo

 public function spawnTo(Player $player)
 {
     $pk = new AddItemEntityPacket();
     $pk->eid = $this->getId();
     $pk->x = $this->x;
     $pk->y = $this->y;
     $pk->z = $this->z;
     $pk->yaw = $this->yaw;
     $pk->pitch = $this->pitch;
     $pk->roll = 0;
     $pk->item = $this->getItem();
     $player->dataPacket($pk);
     $player->addEntityMotion($this->getId(), $this->motionX, $this->motionY, $this->motionZ);
     parent::spawnTo($player);
 }
开发者ID:rryy,项目名称:PocketMine-MP,代码行数:15,代码来源:Item.php

示例9: refreshNPCEquipments

 public static function refreshNPCEquipments(Player $p, StatueModel $npc)
 {
     $slots = [];
     $slots[0] = $npc->armorHelmet;
     $slots[1] = $npc->armorChestplate;
     $slots[2] = $npc->armorLegging;
     $slots[3] = $npc->armorChestplate;
     $p->addEntityMotion(1, $p->motionX, $p->motionY, $p->motionZ);
 }
开发者ID:robozeri,项目名称:SG,代码行数:9,代码来源:StatueBuilder.php


注:本文中的pocketmine\Player::addEntityMotion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。