當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Player::getYaw方法代碼示例

本文整理匯總了PHP中pocketmine\Player::getYaw方法的典型用法代碼示例。如果您正苦於以下問題:PHP Player::getYaw方法的具體用法?PHP Player::getYaw怎麽用?PHP Player::getYaw使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pocketmine\Player的用法示例。


在下文中一共展示了Player::getYaw方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: stdPlayerVars

 /**
  * Basic player specific variable definitions
  * @param Player $player - reference to pocketmine Player
  * @param array &$vars - receives variable defintions
  */
 public function stdPlayerVars(Player $player, array &$vars)
 {
     foreach (["{player}" => $player->getName(), "{displayName}" => $player->getDisplayName(), "{world}" => $player->getLevel()->getName(), "{x}" => (int) $player->getX(), "{y}" => (int) $player->getY(), "{z}" => (int) $player->getZ(), "{yaw}" => (int) $player->getYaw(), "{pitch}" => (int) $player->getPitch(), "{bearing}" => self::bearing($player->getYaw())] as $a => $b) {
         $vars[$a] = $b;
     }
 }
開發者ID:DWWf,項目名稱:pocketmine-plugins,代碼行數:11,代碼來源:ExpandVars.php

示例2: sendMovePlayerPacket

 /**
  * @param Player $player
  * @return bool|int
  */
 public static function sendMovePlayerPacket(Player $player)
 {
     $packet = new MovePlayerPacket();
     $packet->eid = 0;
     $packet->x = $player->getX();
     $packet->y = $player->getY();
     $packet->z = $player->getZ();
     $packet->yaw = $player->getYaw();
     $packet->bodyYaw = $player->getYaw();
     $packet->pitch = $player->getPitch();
     $packet->onGround = false;
     return $player->dataPacket($packet);
 }
開發者ID:Artide,項目名稱:Cameraman,代碼行數:17,代碼來源:Cameraman.php

示例3: teleportPlayer

 public function teleportPlayer(Player $player, Position $pos)
 {
     $player->teleport($pos, $player->getYaw(), $player->getPitch());
     $player->sendMessage("Teleported!");
 }
開發者ID:xHFx,項目名稱:TpaFriends,代碼行數:5,代碼來源:main.php

示例4: setLobby

 public function setLobby($arena, Player $p)
 {
     $config = new Config($this->getDataFolder() . "Arenas/" . $arena . ".yml", Config::YAML);
     $config->setNested("Spawn.Lobby.Welt", $p->getLevel()->getName());
     $config->setNested("Spawn.Lobby.X", $p->getX());
     $config->setNested("Spawn.Lobby.Y", $p->getY());
     $config->setNested("Spawn.Lobby.Z", $p->getZ());
     $config->setNested("Spawn.Lobby.Yaw", $p->getYaw());
     $config->setNested("Spawn.Lobby.Pitch", $p->getPitch());
     $config->save();
 }
開發者ID:Bluplayz,項目名稱:BedwarsPE,代碼行數:11,代碼來源:Bedwars.php

示例5: __construct

 public function __construct(Player $player, Item $item)
 {
     parent::__construct($player->getLevel()->getChunk($player->x >> 4, $player->z >> 4), new Compound("", ["Pos" => new Enum("Pos", [new Double("", $player->x), new Double("", $player->y + $player->getEyeHeight()), new Double("", $player->z)]), "Motion" => new Enum("Motion", [new Double("", 0), new Double("", 0), new Double("", 0)]), "Rotation" => new Enum("Rotation", [new Float("", 0), new Float("", 0)])]));
     $this->item = $item->getID() == 0 ? Item::get(1000, 0, 0) : $item;
     $this->player = $player;
     $this->yaw = $player->getYaw();
     $this->pitch = $player->getPitch();
     parent::spawnToAll();
 }
開發者ID:Skull3x,項目名稱:MineBlock,代碼行數:9,代碼來源:Fishing.php


注:本文中的pocketmine\Player::getYaw方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。