本文整理汇总了PHP中pocketmine\Player::getRawUniqueId方法的典型用法代码示例。如果您正苦于以下问题:PHP Player::getRawUniqueId方法的具体用法?PHP Player::getRawUniqueId怎么用?PHP Player::getRawUniqueId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\Player
的用法示例。
在下文中一共展示了Player::getRawUniqueId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: place
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null)
{
if ($face !== 0) {
$nbt = new CompoundTag("", ["id" => new StringTag("id", Tile::SIGN), "x" => new IntTag("x", $block->x), "y" => new IntTag("y", $block->y), "z" => new IntTag("z", $block->z), "Text1" => new StringTag("Text1", ""), "Text2" => new StringTag("Text2", ""), "Text3" => new StringTag("Text3", ""), "Text4" => new StringTag("Text4", "")]);
if ($player !== null) {
$nbt->Creator = new StringTag("Creator", $player->getRawUniqueId());
}
if ($item->hasCustomBlockData()) {
foreach ($item->getCustomBlockData() as $key => $v) {
$nbt->{$key} = $v;
}
}
if ($face === 1) {
$this->meta = floor(($player->yaw + 180) * 16 / 360 + 0.5) & 0xf;
$this->getLevel()->setBlock($block, Block::get(Item::SIGN_POST, $this->meta), true);
Tile::createTile(Tile::SIGN, $this->getLevel()->getChunk($block->x >> 4, $block->z >> 4), $nbt);
return true;
} else {
$this->meta = $face;
$this->getLevel()->setBlock($block, Block::get(Item::WALL_SIGN, $this->meta), true);
Tile::createTile(Tile::SIGN, $this->getLevel()->getChunk($block->x >> 4, $block->z >> 4), $nbt);
return true;
}
}
return false;
}
示例2: showPlayer
/**
* @param Player $player
*/
public function showPlayer(Player $player)
{
if ($player === $this) {
return;
}
unset($this->hiddenPlayers[$player->getRawUniqueId()]);
if ($player->isOnline()) {
$player->spawnTo($this);
}
}
示例3: removeOnlinePlayer
public function removeOnlinePlayer(Player $player)
{
if (isset($this->playerList[$player->getRawUniqueId()])) {
unset($this->playerList[$player->getRawUniqueId()]);
$pk = new PlayerListPacket();
$pk->type = PlayerListPacket::TYPE_REMOVE;
$pk->entries[] = [$player->getUniqueId()];
Server::broadcastPacket($this->playerList, $pk);
}
}
示例4: defaultLoginData
protected static function defaultLoginData($uid, Player $player)
{
$name = $player->getName();
$ip = $player->getAddress();
return ["uid" => $uid, "name" => $name, "nicks" => "|{$name}|", "lastip" => "", "status" => Settings::STATUS_OFFLINE, "lastses" => Settings::$LOCALIZE_CLASS, "authuuid" => $player->getRawUniqueId(), "coins" => 0.0, "hash" => str_repeat("0", 128), "pwprefix" => "", "pwlen" => 0, "registration" => time(), "laston" => time(), "ontime" => 0, "config" => Settings::CONFIG_DEFAULT_VALUE, "lastgrind" => 0, "rank" => 0, "warnpts" => 0, "lastwarn" => 0, "tid" => -1, "teamrank" => -1, "teamjoin" => 0, "teampts" => 0, "teamname" => "", "ignorelist" => ",", "iphist" => ",{$ip},", "isnew" => true, "email" => self::EMAIL_UNVERIFIED, "friends" => [Friend::FRIEND_ENEMY => [], Friend::FRIEND_ACQUAINTANCE => [], Friend::FRIEND_GOOD_FRIEND => [], Friend::FRIEND_BEST_FRIEND => []], "langs" => [], "purchases" => [], "channels" => [], "kitrowsarray" => []];
}