本文整理汇总了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;
}
}
示例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);
}
示例3: teleportPlayer
public function teleportPlayer(Player $player, Position $pos)
{
$player->teleport($pos, $player->getYaw(), $player->getPitch());
$player->sendMessage("Teleported!");
}
示例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();
}
示例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();
}