本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}