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


PHP Player::getLoaderId方法代碼示例

本文整理匯總了PHP中pocketmine\Player::getLoaderId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Player::getLoaderId方法的具體用法?PHP Player::getLoaderId怎麽用?PHP Player::getLoaderId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pocketmine\Player的用法示例。


在下文中一共展示了Player::getLoaderId方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: spawnTo

 public function spawnTo(Player $player)
 {
     if ($player !== $this and !isset($this->hasSpawned[$player->getLoaderId()])) {
         $this->hasSpawned[$player->getLoaderId()] = $player;
         $pk = new AddPlayerPacket();
         $pk->uuid = $this->getUniqueId();
         $pk->username = $this->getName();
         $pk->eid = $this->getId();
         $pk->x = $this->x;
         $pk->y = $this->y;
         $pk->z = $this->z;
         $pk->speedX = 0;
         $pk->speedY = 0;
         $pk->speedZ = 0;
         $pk->yaw = $this->yaw;
         $pk->pitch = $this->pitch;
         $item = $this->getInventory()->getItemInHand();
         $pk->item = $item;
         if ($player->hasPermission("slapper.seeownskin")) {
             $pk->skin = $player->getSkinData();
             $pk->slim = $player->isSkinSlim();
         } else {
             $pk->skin = $this->skin;
             $pk->slim = $this->isSlim;
         }
         $pk->metadata = [2 => [4, $this->getDataProperty(2)], 3 => [0, $this->getDataProperty(3)], 15 => [0, 1]];
         $player->dataPacket($pk->setChannel(Network::CHANNEL_ENTITY_SPAWNING));
         $this->inventory->sendArmorContents($player);
     }
 }
開發者ID:EpicArtz08999,項目名稱:Development,代碼行數:30,代碼來源:SlapperHuman.php

示例2: spawnTo

 public function spawnTo(Player $player)
 {
     if ($player !== $this and !isset($this->hasSpawned[$player->getLoaderId()])) {
         $this->hasSpawned[$player->getLoaderId()] = $player;
         $uuid = $this->getUniqueId();
         $entityId = $this->getId();
         $pk = new AddPlayerPacket();
         $pk->uuid = $uuid;
         $pk->username = "";
         $pk->eid = $entityId;
         $pk->x = $this->x;
         $pk->y = $this->y;
         $pk->z = $this->z;
         $pk->yaw = $this->yaw;
         $pk->pitch = $this->pitch;
         $pk->item = $this->getInventory()->getItemInHand();
         $pk->metadata = [2 => [4, str_ireplace("{name}", $player->getName(), str_ireplace("{display_name}", $player->getDisplayName(), $player->hasPermission("slapper.seeId") ? $this->getDataProperty(2) . "\n" . \pocketmine\utils\TextFormat::GREEN . "Entity ID: " . $entityId : $this->getDataProperty(2)))], 3 => [0, $this->getDataProperty(3)], 15 => [0, 1]];
         $player->dataPacket($pk);
         $this->inventory->sendArmorContents($player);
         $add = new PlayerListPacket();
         $add->type = 0;
         $add->entries[] = [$uuid, $entityId, isset($this->namedtag->MenuName) ? $this->namedtag["MenuName"] : "", $this->skinName, $this->skin];
         $player->dataPacket($add);
         if ($this->namedtag["MenuName"] === "") {
             $remove = new PlayerListPacket();
             $remove->type = 1;
             $remove->entries[] = [$uuid];
             $player->dataPacket($remove);
         }
     }
 }
開發者ID:PMPlugins,項目名稱:Slapper,代碼行數:31,代碼來源:SlapperHuman.php

示例3: spawnTo

 public function spawnTo(Player $player)
 {
     if (!isset($this->hasSpawned[$player->getLoaderId()]) && isset($player->usedChunks[Level::chunkHash($this->chunk->getX(), $this->chunk->getZ())])) {
         $pk = new AddEntityPacket();
         $pk->eid = $this->getID();
         $pk->type = static::NETWORK_ID;
         $pk->x = $this->x;
         $pk->y = $this->y;
         $pk->z = $this->z;
         $pk->speedX = 0;
         $pk->speedY = 0;
         $pk->speedZ = 0;
         $pk->yaw = $this->yaw;
         $pk->pitch = $this->pitch;
         $pk->metadata = $this->dataProperties;
         $player->dataPacket($pk);
         $this->hasSpawned[$player->getLoaderId()] = $player;
     }
 }
開發者ID:steveritter,項目名稱:EntityManager,代碼行數:19,代碼來源:BaseEntity.php

示例4: requestChunk

 public function requestChunk($x, $z, Player $player)
 {
     $index = Level::chunkHash($x, $z);
     if (!isset($this->chunkSendQueue[$index])) {
         $this->chunkSendQueue[$index] = [];
     }
     $this->chunkSendQueue[$index][$player->getLoaderId()] = $player;
 }
開發者ID:robozeri,項目名稱:Yuriko-MP,代碼行數:8,代碼來源:Level.php

示例5: despawnFrom

 public function despawnFrom(Player $player)
 {
     if (isset($this->hasSpawned[$player->getLoaderId()])) {
         $pk = new RemoveEntityPacket();
         $pk->eid = $this->getId();
         $player->dataPacket($pk);
         unset($this->hasSpawned[$player->getLoaderId()]);
     }
 }
開發者ID:robske110,項目名稱:ClearSky,代碼行數:9,代碼來源:Human.php

示例6: despawnFrom

 public function despawnFrom(Player $player)
 {
     if (isset($this->hasSpawned[$player->getLoaderId()])) {
         if ($this instanceof Player) {
             $this->server->removePlayerListData($this->getUniqueId(), [$player]);
         }
         $pk = new RemovePlayerPacket();
         $pk->eid = $this->getId();
         $pk->clientId = $this->getUniqueId();
         $player->dataPacket($pk);
         unset($this->hasSpawned[$player->getLoaderId()]);
     }
 }
開發者ID:ajreimine,項目名稱:PocketMine-0.13.x,代碼行數:13,代碼來源:Human.php

示例7: spawnTo

 /**
  * @param Player $player
  */
 public function spawnTo(Player $player)
 {
     if (!isset($this->hasSpawned[$player->getLoaderId()]) and isset($player->usedChunks[Level::chunkHash($this->chunk->getX(), $this->chunk->getZ())])) {
         $this->hasSpawned[$player->getLoaderId()] = $player;
     }
 }
開發者ID:Cecil107,項目名稱:PocketMine-0.13.0,代碼行數:9,代碼來源:Entity.php

示例8: onActivate

 public function onActivate(Item $item, Player $player = null)
 {
     if (($this->getDamage() & 0x8) === 0x8) {
         //Top
         $down = $this->getSide(Vector3::SIDE_DOWN);
         if ($down->getId() === $this->getId()) {
             $meta = $down->getDamage() ^ 0x4;
             $this->getLevel()->setBlock($down, Block::get($this->getId(), $meta), true);
             $players = $this->getLevel()->getChunkPlayers($this->x >> 4, $this->z >> 4);
             if ($player instanceof Player) {
                 unset($players[$player->getLoaderId()]);
             }
             $this->level->addSound(new DoorSound($this));
             return true;
         }
         return false;
     } else {
         $this->meta ^= 0x4;
         $this->getLevel()->setBlock($this, $this, true);
         $players = $this->getLevel()->getChunkPlayers($this->x >> 4, $this->z >> 4);
         if ($player instanceof Player) {
             unset($players[$player->getLoaderId()]);
         }
         $this->level->addSound(new DoorSound($this));
     }
     return true;
 }
開發者ID:iTXTech,項目名稱:Genisys,代碼行數:27,代碼來源:Door.php

示例9: requestChunk

 public function requestChunk($x, $z, Player $player)
 {
     $index = \PHP_INT_SIZE === 8 ? ($x & 0xffffffff) << 32 | $z & 0xffffffff : $x . ":" . $z;
     if (!isset($this->chunkSendQueue[$index])) {
         $this->chunkSendQueue[$index] = [];
     }
     $this->chunkSendQueue[$index][$player->getLoaderId()] = $player;
 }
開發者ID:xpyctum,項目名稱:PocketMinePlusPlus,代碼行數:8,代碼來源:Level.php

示例10: requestChunk

 public function requestChunk($x, $z, Player $player)
 {
     $index = ($x & 0xffffffff) << 32 | $z & 0xffffffff;
     if (!isset($this->chunkSendQueue[$index])) {
         $this->chunkSendQueue[$index] = [];
     }
     $this->chunkSendQueue[$index][$player->getLoaderId()] = $player;
 }
開發者ID:xpyctum,項目名稱:PocketMinePlusPlus,代碼行數:8,代碼來源:Level__64bit.php

示例11: despawnFrom

 public function despawnFrom(Player $player)
 {
     if (isset($this->hasSpawned[$player->getLoaderId()])) {
         $pk = new RemovePlayerPacket();
         $pk->eid = $this->getId();
         $pk->clientID = $this->getId();
         $player->dataPacket($pk->setChannel(Network::CHANNEL_ENTITY_SPAWNING));
         unset($this->hasSpawned[$player->getLoaderId()]);
     }
 }
開發者ID:mattiasaxelsson,項目名稱:PocketMine-MP,代碼行數:10,代碼來源:Human.php

示例12: despawnFrom

 /**
  *
  * @param Player $player        	
  */
 public function despawnFrom(Player $player)
 {
     if (isset($this->hasSpawned[$player->getLoaderId()])) {
         $pk = new RemovePlayerPacket();
         $pk->eid = $this->getId();
         $pk->clientId = $this->dummyReceiver->randomUUID;
         $player->dataPacket($pk);
         unset($this->hasSpawned[$player->getLoaderId()]);
     }
 }
開發者ID:organization,項目名稱:DummyPlayer,代碼行數:14,代碼來源:BaseEntity.php


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