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


PHP Player::getRemoveFormat方法代码示例

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


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

示例1: spawnTo

 public function spawnTo(Player $player)
 {
     if ($player instanceof DesktopPlayer) {
         if ($this !== $player and $this->spawned === true and $player->getLevel() === $this->getLevel() and $player->canSee($this)) {
             $this->hasSpawned[$player->getID()] = $player;
             $pk = new SpawnPlayerPacket();
             if ($player->getRemoveFormat()) {
                 $pk->name = TextFormat::clean($this->nameTag);
             } else {
                 $pk->name = $this->nameTag;
             }
             $pk->eid = $this->getID();
             $pk->uuid = $this->bigBrother_formatedUUID;
             $pk->x = $this->x;
             $pk->z = $this->y;
             $pk->y = $this->z;
             $pk->yaw = $this->yaw;
             $pk->pitch = $this->pitch;
             $pk->item = $this->inventory->getItemInHand()->getID();
             $pk->metadata = $this->getData();
             $pk->data = $this->bigBrother_properties;
             $player->putRawPacket($pk);
             $pk = new EntityTeleportPacket();
             $pk->eid = $this->getID();
             $pk->x = $this->x;
             $pk->z = $this->y;
             $pk->y = $this->z;
             $pk->yaw = $this->yaw;
             $pk->pitch = $this->pitch;
             $player->putRawPacket($pk);
             $pk = new SetEntityMotionPacket();
             $pk->eid = $this->getID();
             $pk->speedX = $this->motionX;
             $pk->speedY = $this->motionY;
             $pk->speedZ = $this->motionZ;
             $player->dataPacket($pk);
             $this->inventory->sendHeldItem($player);
             $this->inventory->sendArmorContents($player);
         }
     } else {
         parent::spawnTo($player);
     }
 }
开发者ID:vibrocil,项目名称:BigBrother,代码行数:43,代码来源:DesktopPlayer.php

示例2: 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;
         $pk->unknown1 = 0;
         $pk->unknown2 = 0;
         $pk->metadata = $this->getData();
         $player->dataPacket($pk);
         $pk = new SetEntityMotionPacket();
         $pk->entities = [[$this->getID(), $this->motionX, $this->motionY, $this->motionZ]];
         $player->dataPacket($pk);
         $this->inventory->sendHeldItem($player);
         $this->inventory->sendArmorContents($player);
     }
 }
开发者ID:boybook,项目名称:PocketMine-MP,代码行数:28,代码来源:Human.php

示例3: 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


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