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


PHP PlayerJoinEvent::getPlayer方法代码示例

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


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

示例1: onJoin

 public function onJoin(PlayerJoinEvent $event)
 {
     $this->sessions[$id = $event->getPlayer()->getId()] = new Session($this, $event->getPlayer());
     if ($this->defaultEnable) {
         $this->sessions[$id]->enable();
     }
 }
开发者ID:barnseyminesuk,项目名称:Small-ZC-Plugins,代码行数:7,代码来源:ThirdPersonDiscour.php

示例2: onJoin

 public function onJoin(PlayerJoinEvent $event)
 {
     if (!$event->getPlayer() instanceof Player) {
         return;
     }
     $event->getPlayer()->setDataProperty(Entity::DATA_SHOW_NAMETAG, Entity::DATA_TYPE_BYTE, 0);
 }
开发者ID:nesgohood,项目名称:PMMP-Plugins,代码行数:7,代码来源:hideNameTAG.php

示例3: onJoin

 public function onJoin(PlayerJoinEvent $event)
 {
     $player = $event->getPlayer();
     $cfg = $this->plugin->getConfig()->getAll();
     if ($cfg["show-join-message"]) {
         $player->sendMessage($this->plugin->translateColors("&", $cfg["prefix"] . ServerAuth::getAPI()->getConfigLanguage()->getAll()["join-message"]));
     }
     if (ServerAuth::getAPI()->isPlayerAuthenticated($player)) {
         //IP Authentication
         if ($cfg["IPLogin"]) {
             $playerdata = ServerAuth::getAPI()->getPlayerData($player->getName());
             if ($playerdata["ip"] == $player->getAddress()) {
                 ServerAuth::getAPI()->authenticatePlayer($player, $playerdata["password"], false);
                 $player->sendMessage($this->plugin->translateColors("&", $cfg["prefix"] . ServerAuth::getAPI()->getConfigLanguage()->getAll()["login"]["ip-login"]));
             } else {
                 ServerAuth::getAPI()->deauthenticatePlayer($event->getPlayer());
             }
         } else {
             ServerAuth::getAPI()->deauthenticatePlayer($event->getPlayer());
         }
     }
     if (!ServerAuth::getAPI()->isPlayerRegistered($player->getName()) && ServerAuth::getAPI()->areRegisterMessagesEnabled()) {
         if ($cfg["register"]["password-confirm-required"]) {
             $player->sendMessage($this->plugin->translateColors("&", $cfg["prefix"] . ServerAuth::getAPI()->getConfigLanguage()->getAll()["register"]["message-conf"]));
         } else {
             $player->sendMessage($this->plugin->translateColors("&", $cfg["prefix"] . ServerAuth::getAPI()->getConfigLanguage()->getAll()["register"]["message"]));
         }
     } else {
         if (!ServerAuth::getAPI()->isPlayerAuthenticated($player) && ServerAuth::getAPI()->areLoginMessagesEnabled()) {
             $player->sendMessage($this->plugin->translateColors("&", $cfg["prefix"] . ServerAuth::getAPI()->getConfigLanguage()->getAll()["login"]["message"]));
         }
     }
 }
开发者ID:RedstoneAlmeida,项目名称:SliceAuth,代码行数:33,代码来源:EventListener.php

示例4: onPlayerJoin

 public function onPlayerJoin(PlayerJoinEvent $event)
 {
     $player = $event->getPlayer();
     if ($player instanceof Player) {
         $this->plugin->petOwnerRegister($player, $event->getPlayer()->getPosition()->getLevel()->getName());
     }
 }
开发者ID:flaxues,项目名称:BuddyPets,代码行数:7,代码来源:EventListener.php

示例5: onJoin

 public function onJoin(PlayerJoinEvent $event)
 {
     $x = $this->plugin->getServer()->getDefaultLevel()->getSafeSpawn()->getX();
     $y = $this->plugin->getServer()->getDefaultLevel()->getSafeSpawn()->getY();
     $z = $this->plugin->getServer()->getDefaultLevel()->getSafeSpawn()->getZ();
     $event->getPlayer()->teleport($event->getPlayer()->getLevel()->getSafeSpawn());
     $this->debug->onDebug('Zum Start teleportiert');
 }
开发者ID:LittleBigMC,项目名称:Minecraft-Pocket-Edition,代码行数:8,代码来源:allwaysonspawn.php

示例6: join

 public function join(pje $e)
 {
     if ($this->isStart()) {
         $this->setOni($e->getPlayer());
     } else {
         $this->setHuman($e->getPlayer());
     }
 }
开发者ID:moinngmg,项目名称:Onigo,代码行数:8,代码来源:Main.php

示例7: onPlayerJoin

 public function onPlayerJoin(PlayerJoinEvent $event)
 {
     foreach ($this->npc as $npc) {
         if ($npc->getLevel()->getFolderName() === $event->getPlayer()->getLevel()->getFolderName()) {
             $npc->spawnTo($event->getPlayer());
         }
     }
 }
开发者ID:wodnr0804,项目名称:NPC,代码行数:8,代码来源:Main.php

示例8: onPlayerJoin

 public function onPlayerJoin(PlayerJoinEvent $event)
 {
     if (isset($this->pendingPlayers[$event->getPlayer()->getName()])) {
         $fetch = new CommandFetchTask($this->getOwner(), ["users" => [$event->getPlayer()->getName()], "offlineCommands" => false]);
         $fetch->call();
         unset($this->pendingPlayers[$event->getPlayer()->getName()]);
     }
 }
开发者ID:GeenoMC,项目名称:BuyCraft,代码行数:8,代码来源:PendingPlayerCheckerTask.php

示例9: onJoin

 public function onJoin(PlayerJoinEvent $event)
 {
     if (isset($this->db["IP"][$event->getPlayer()->getAddress()])) {
         $this->message($event->getPlayer(), "자동 로그인 되었습니다 ! (IP로그인)");
         return;
     } else {
         $this->deauthenticatePlayer($player);
     }
 }
开发者ID:EmreTr1,项目名称:rtr,代码行数:9,代码来源:emailAuth.php

示例10: onJoin

 public function onJoin(PlayerJoinEvent $ev)
 {
     if (!file_exists($this->getDataFolder() . "players/" . $ev->getPlayer()->getName() . ".yml")) {
         $config = new Config($this->getDataFolder() . "players/" . strtolower($ev->getPlayer()->getName()) . ".yml", Config::YAML);
         $config->set("friends", array());
         $config->save();
         echo "made config for " . $ev->getPlayer()->getName();
     }
 }
开发者ID:TheGoldenPickle,项目名称:Friends,代码行数:9,代码来源:main.php

示例11: onJoin

 public function onJoin(PlayerJoinEvent $event)
 {
     $spawn = $this->plugin->getNextSpawn();
     $event->getPlayer()->teleport($spawn);
     $this->plugin->players = $this->plugin->players + 1;
     $event->setJoinMessage("[HG] " . $event->getPlayer()->getName() . " joined the match!");
     if (!$this->plugin->points->exists($event->getPlayer()->getName())) {
         $this->plugin->points->set($event->getPlayer()->getName(), array("kills" => 0, "deaths" => 0));
     }
 }
开发者ID:Skull3x,项目名称:WonderCore,代码行数:10,代码来源:EventHandler.php

示例12: onPlayerJoin

 public function onPlayerJoin(PlayerJoinEvent $event)
 {
     $this->plugin->log("[HG] StatueListener: onPlayerJoin for player " . $event->getPlayer()->getName());
     $player = $event->getPlayer();
     if (!isset($this->plugin->getStatueManager()->npcsSpawns[$player->getName()])) {
         $this->plugin->getStatueManager->npcsSpawns[$player->getName()] = $player->getName();
         $builder = new StatueBuilder($this->plugin);
         $builder->displayStatues($player, $this->plugin->statueManager->npcs);
     }
 }
开发者ID:robozeri,项目名称:SG,代码行数:10,代码来源:StatueListener.php

示例13: onPlayerJoin

 public function onPlayerJoin(PlayerJoinEvent $event)
 {
     $this->getServer()->getScheduler()->scheduleRepeatingTask(new Task($this, $this->cfg->get("duration")), 10);
     $type = $this->cfg->get("type");
     $message = $this->cfg->get("message");
     if ($type == "tip") {
         $event->getPlayer()->sendTip($message);
     } elseif ($type == "popup") {
         $event->getPlayer()->sendPopup($message);
     }
 }
开发者ID:BB3900YT,项目名称:PopupDisplayer,代码行数:11,代码来源:Main.php

示例14: onPlayerJoin

 /**
  * @param PlayerJoinEvent $event
  *
  * @priority LOWEST
  */
 public function onPlayerJoin(PlayerJoinEvent $event)
 {
     if ($this->plugin->getConfig()->get("authenticateByLastUniqueId") === true and $event->getPlayer()->hasPermission("simpleauth.lastid")) {
         $config = $this->plugin->getDataProvider()->getPlayer($event->getPlayer());
         if ($config !== null and $config["lastip"] === $event->getPlayer()->getUniqueId()->toString()) {
             $this->plugin->authenticatePlayer($event->getPlayer());
             return;
         }
     }
     $this->plugin->deauthenticatePlayer($event->getPlayer());
 }
开发者ID:ecoron,项目名称:SimpleAuth,代码行数:16,代码来源:EventListener.php

示例15: onJoinEvent

 public function onJoinEvent(PlayerJoinEvent $event)
 {
     $config = $this->getConfig();
     foreach ($this->getServer()->getOnlinePlayers() as $players) {
         $playerName = $event->getPlayer()->getName();
         $msg2 = $config->get("Announce-Join");
         $msg2 = str_replace("{PLAYER}", $playerName, $msg2);
         $msg = $config->get("Message-Join");
         $msg = str_replace("{PLAYER}", $playerName, $msg);
         $p = $event->getPlayer();
         $players->sendTip($msg2);
         $p->sendTip($msg);
     }
 }
开发者ID:XxD7omGamer,项目名称:EasyTips,代码行数:14,代码来源:Main.php


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