當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UUID::fromData方法代碼示例

本文整理匯總了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);
 }
開發者ID:organization,項目名稱:SpawningPool,代碼行數:33,代碼來源:AuthenticateCallback.php


注:本文中的UUID::fromData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。