本文整理汇总了PHP中UUID::fromData方法的典型用法代码示例。如果您正苦于以下问题:PHP UUID::fromData方法的具体用法?PHP UUID::fromData怎么用?PHP UUID::fromData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UUID
的用法示例。
在下文中一共展示了UUID::fromData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialHuman
private function initialHuman(Player $player)
{
$player->setDataFlag($player::DATA_PLAYER_FLAGS, $player::DATA_PLAYER_FLAG_SLEEP, false);
$player->setDataProperty($player::DATA_PLAYER_BED_POSITION, $player::DATA_TYPE_POS, [0, 0, 0]);
$inventory = new PlayerInventory($player);
$this->setPrivateVariableData($player, 'inventory', $inventory);
if ($player instanceof Player) {
$player->addWindow($inventory, 0);
}
if (!$player instanceof Player) {
if (isset($player->namedtag->NameTag)) {
$player->setNameTag($player->namedtag["NameTag"]);
}
if (isset($player->namedtag->Skin) and $player->namedtag->Skin instanceof CompoundTag) {
$player->setSkin($player->namedtag->Skin["Data"], $player->namedtag->Skin["Slim"] > 0);
}
$this->setPrivateVariableData($player, 'uuid', UUID::fromData($player->getId(), $player->getSkinData(), $player->getNameTag()));
}
if (isset($player->namedtag->Inventory) and $player->namedtag->Inventory instanceof ListTag) {
foreach ($player->namedtag->Inventory as $item) {
if ($item["Slot"] >= 0 and $item["Slot"] < 9) {
// Hotbar
$player->inventory->setHotbarSlotIndex($item["Slot"], isset($item["TrueSlot"]) ? $item["TrueSlot"] : -1);
} elseif ($item["Slot"] >= 100 and $item["Slot"] < 104) {
// Armor
$player->getInventory()->setItem($player->getInventory()->getSize() + $item["Slot"] - 100, NBT::getItemHelper($item));
} else {
$player->getInventory()->setItem($item["Slot"] - 9, NBT::getItemHelper($item));
}
}
}
$this->initialEntity($player);
}