当前位置: 首页>>代码示例>>PHP>>正文


PHP Player::getID方法代码示例

本文整理汇总了PHP中pocketmine\Player::getID方法的典型用法代码示例。如果您正苦于以下问题:PHP Player::getID方法的具体用法?PHP Player::getID怎么用?PHP Player::getID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pocketmine\Player的用法示例。


在下文中一共展示了Player::getID方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: spawnTo

 public function spawnTo(Player $player)
 {
     if ($player instanceof DesktopPlayer) {
         if ($this !== $player and $this->spawned === true and $player->getLevel() === $this->getLevel() and $player->canSee($this)) {
             $this->hasSpawned[$player->getID()] = $player;
             $pk = new SpawnPlayerPacket();
             if ($player->getRemoveFormat()) {
                 $pk->name = TextFormat::clean($this->nameTag);
             } else {
                 $pk->name = $this->nameTag;
             }
             $pk->eid = $this->getID();
             $pk->uuid = $this->bigBrother_formatedUUID;
             $pk->x = $this->x;
             $pk->z = $this->y;
             $pk->y = $this->z;
             $pk->yaw = $this->yaw;
             $pk->pitch = $this->pitch;
             $pk->item = $this->inventory->getItemInHand()->getID();
             $pk->metadata = $this->getData();
             $pk->data = $this->bigBrother_properties;
             $player->putRawPacket($pk);
             $pk = new EntityTeleportPacket();
             $pk->eid = $this->getID();
             $pk->x = $this->x;
             $pk->z = $this->y;
             $pk->y = $this->z;
             $pk->yaw = $this->yaw;
             $pk->pitch = $this->pitch;
             $player->putRawPacket($pk);
             $pk = new SetEntityMotionPacket();
             $pk->eid = $this->getID();
             $pk->speedX = $this->motionX;
             $pk->speedY = $this->motionY;
             $pk->speedZ = $this->motionZ;
             $player->dataPacket($pk);
             $this->inventory->sendHeldItem($player);
             $this->inventory->sendArmorContents($player);
         }
     } else {
         parent::spawnTo($player);
     }
 }
开发者ID:vibrocil,项目名称:BigBrother,代码行数:43,代码来源:DesktopPlayer.php

示例2: freeChunk

 /**
  * WARNING: Do not use this, it's only for internal use.
  * Changes to this function won't be recorded on the version.
  *
  * @param int    $X
  * @param int    $Z
  * @param Player $player
  */
 public function freeChunk($X, $Z, Player $player)
 {
     unset($this->usedChunks[$index = Level::chunkHash($X, $Z)][$player->getID()]);
     $this->unloadChunkRequest($X, $Z, true);
 }
开发者ID:boybook,项目名称:PocketMine-MP,代码行数:13,代码来源:Level.php

示例3: despawnFrom

 public function despawnFrom(Player $player)
 {
     if (isset($this->hasSpawned[$player->getID()])) {
         $pk = new RemovePlayerPacket();
         $pk->eid = $this->id;
         $pk->clientID = 0;
         $player->dataPacket($pk);
         unset($this->hasSpawned[$player->getID()]);
     }
 }
开发者ID:boybook,项目名称:PocketMine-MP,代码行数:10,代码来源:Human.php

示例4: onLoggedIn

 public function onLoggedIn(Player $player)
 {
     if (isset($this->loggedIn[$player->getID()])) {
         return;
     }
     $f = $this->getFList()->getFaction($player);
     if (!$f instanceof Faction) {
         return;
     }
     $f->setActiveNow();
     $this->loggedIn[$player->getID()] = true;
 }
开发者ID:MCPEGamerJPatGitHub,项目名称:PocketFactions,代码行数:12,代码来源:Main.php

示例5: onActivate

 public function onActivate(Item $item, Player $player = null)
 {
     if (($this->meta & 0x8) === 0x8) {
         //Top
         $down = $this->getSide(0);
         if ($down->getID() === $this->id) {
             $meta = $down->getDamage() ^ 0x4;
             $this->getLevel()->setBlock($down, Block::get($this->id, $meta), true);
             $players = $this->getLevel()->getUsingChunk($this->x >> 4, $this->z >> 4);
             if ($player instanceof Player) {
                 unset($players[$player->getID()]);
             }
             $pk = new LevelEventPacket();
             $pk->x = $this->x;
             $pk->y = $this->y;
             $pk->z = $this->z;
             $pk->evid = 1003;
             $pk->data = 0;
             Server::broadcastPacket($players, $pk);
             return true;
         }
         return false;
     } else {
         $this->meta ^= 0x4;
         $this->getLevel()->setBlock($this, $this, true);
         $players = $this->getLevel()->getUsingChunk($this->x >> 4, $this->z >> 4);
         if ($player instanceof Player) {
             unset($players[$player->getID()]);
         }
         $pk = new LevelEventPacket();
         $pk->x = $this->x;
         $pk->y = $this->y;
         $pk->z = $this->z;
         $pk->evid = 1003;
         $pk->data = 0;
         Server::broadcastPacket($players, $pk);
     }
     return true;
 }
开发者ID:boybook,项目名称:PocketMine-MP,代码行数:39,代码来源:Door.php

示例6: getAnchor

 /**
  * @param Player $player
  * @return bool|Position
  */
 public function getAnchor(Player $player)
 {
     return isset($this->anchors[$player->getID()]) ? $this->anchors[$player->getID()] : false;
 }
开发者ID:barnseyminesuk,项目名称:Small-ZC-Plugins,代码行数:8,代码来源:WorldEditArt.php

示例7: offset

 public static function offset(Player $player)
 {
     return $player->getID();
 }
开发者ID:LegionPE,项目名称:LegionPE-Eta,代码行数:4,代码来源:Session.php

示例8: despawnFrom

 public function despawnFrom(Player $player)
 {
     if (isset($this->hasSpawned[$player->getID()])) {
         $this->entityevent_pk->eid = $this->id;
         $this->entityevent_pk->event = 3;
         if ($player != null) {
             $player->dataPacket($this->entityevent_pk);
             $this->removeentity_pk->eid = $this->id;
             $this->server->getScheduler()->scheduleDelayedTask(new CallbackTask([$player, "dataPacket"], [$this->removeentity_pk]), 23);
         }
         unset($this->hasSpawned[$player->getID()]);
     }
 }
开发者ID:EmreTr1,项目名称:rtr,代码行数:13,代码来源:EconomyEntities.php

示例9: offset

 private function offset(Player $player)
 {
     return $player->getID();
 }
开发者ID:barnseyminesuk,项目名称:Small-ZC-Plugins,代码行数:4,代码来源:NailedKeyboard.php

示例10: finalizePlayer

 public function finalizePlayer(Player $player, $isQuit)
 {
     if (isset($this->stack[$id = $player->getID()])) {
         unset($this->stack[$id]);
         // avoid bugs if the entity ID gets reused
         if ($isQuit) {
             $this->getLogger()->alert($player->getDisplayName() . " has quit, so his recording macro has been discarded.");
         } else {
             $this->getLogger()->alert("Discarding recording macro of " . $player->getDisplayName() . " due to plugin disable.");
             $player->sendMessage("Your recording macro has been discarded due to SimpleMacros being disabled.");
         }
     }
     if (isset($this->paused[$id])) {
         unset($this->stack[$id]);
     }
     if (isset($this->atts[$id])) {
         unset($this->atts[$id]);
     }
 }
开发者ID:barnseyminesuk,项目名称:Small-ZC-Plugins,代码行数:19,代码来源:Main.php


注:本文中的pocketmine\Player::getID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。