当前位置: 首页>>代码示例>>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;未经允许,请勿转载。