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


PHP player\PlayerRespawnEvent类代码示例

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


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

示例1: onPlayerRespawn

 public function onPlayerRespawn(PlayerRespawnEvent $event)
 {
     //TODO send kit info
     if (isset($this->players[$event->getPlayer()->getName()])) {
         unset($this->players[$event->getPlayer()->getName()]);
     }
 }
开发者ID:haruajsuru,项目名称:BattleKits,代码行数:7,代码来源:KitHistoryStore.php

示例2: onRespawn

 public function onRespawn(PlayerRespawnEvent $e)
 {
     $cfg = $this->getConfig();
     $player = $e->getPlayer();
     $player->getInventory()->setItem(25, Item::get($cfg->get("HidePlayers-Item"), 0, 1));
     $player->getInventory()->setItem(26, Item::get($cfg->get("ShowPlayers-Item"), 0, 1));
 }
开发者ID:TonyDroidd,项目名称:HideAllPlayers,代码行数:7,代码来源:Main.php

示例3: onPlayerRespawn

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

示例4: onPlayerRespawned

 public function onPlayerRespawned(PlayerRespawnEvent $event)
 {
     $p = $event->getPlayer();
     $level = $p->getLevel();
     $light = new AddEntityPacket();
     $light->type = 93;
     $light->eid = Entity::$entityCount++;
     $light->metadata = array();
     $light->speedX = 9;
     $light->speedY = 0;
     $light->speedZ = -9;
     $light->yaw = $p->getYaw();
     $light->pitch = $p->getPitch();
     $light->x = $p->x;
     $light->y = $p->y;
     $light->z = $p->z;
     foreach ($level->getPlayers() as $pl) {
         $pl->dataPacket($light);
         $pl->addEffect(Effect::getEffect(Effect::SPEED)->setAmplifier(3)->setDuration(30000));
         $pl->setGamemode(2);
         $pl->getInventory()->addItem(new Item(Item::COOKIE, 0, 64));
         $pl->getInventory()->addItem(new Item(Item::SLIMEBALL, 0, 1));
         $pl->getInventory()->addItem(new Item(Item::COAL, 0, 1));
         $pl->getInventory()->addItem(new Item(Item::GUNPOWDER, 0, 1));
     }
 }
开发者ID:Pab450,项目名称:SkyWorld_Server,代码行数:26,代码来源:Plugin.php

示例5: onRespawn

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

示例6: onRespawn

 public function onRespawn(PlayerRespawnEvent $event)
 {
     $cg = $this->getConfig();
     $enablerecieveafterdeath = $cg->get("Enable-Receive-After-Death");
     if ($enablerecieveafterdeath == true) {
         $p = $event->getPlayer();
         $this->getServer()->getScheduler()->scheduleDelayedTask(new FineTask([$this, "Receive"], [$p]), 0);
     }
 }
开发者ID:GoneTone,项目名称:Chinese-Traditional-Translations-For-PocketMine-MP-Plugins,代码行数:9,代码来源:FineJoinEffects.php

示例7: checkRespawn

 public function checkRespawn(PlayerRespawnEvent $event)
 {
     $player = $event->getPlayer();
     foreach ($player->getInventory()->getContents() as $item) {
         if ($item->getID() == Item::CRAFTING_TABLE) {
             return;
         }
     }
     $player->getInventory()->addItem(Item::get(Item::CRAFTING_TABLE));
 }
开发者ID:EmreTr1,项目名称:rtr,代码行数:10,代码来源:FreeCraftingTable.php

示例8: onPlayerRespawn

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

示例9: onPlayerRespawn

 public function onPlayerRespawn(PlayerRespawnEvent $event)
 {
     if ($this->plugin->hasPlayedBefore($event->getPlayer()) && $this->plugin->isJailed($event->getPlayer())) {
         $t = $this->getPlugin()->data->getAll();
         $j = $this->getPlugin()->data2->getAll();
         $jail = $t[$event->getPlayer()->getName()]["jail"];
         if ($this->getPlugin()->jailExists($jail)) {
             $event->setRespawnPosition(new Position($j[$jail]["x"], $j[$jail]["y"], $j[$jail]["z"], $this->getPlugin()->getServer()->getLevelByName($j[$jail]["world"])));
         }
     }
 }
开发者ID:HerO-0110,项目名称:Jail,代码行数:11,代码来源:PlayerListener.php

示例10: onPlayerRespawn

 public function onPlayerRespawn(PlayerRespawnEvent $event)
 {
     $isMoveRequired = true;
     foreach (self::$respawnableGames as $game) {
         if ($game->isPlayerPlaying($event->getPlayer()->getName())) {
             $isMoveRequired = false;
             break;
         }
     }
     if ($isMoveRequired) {
         $event->setRespawnPosition(Server::getInstance()->getDefaultLevel()->getSpawnLocation());
     }
 }
开发者ID:organization,项目名称:GameCoreFramework,代码行数:13,代码来源:GCFramework.php

示例11: onRespawn

 public function onRespawn(PlayerRespawnEvent $ent)
 {
     $player = $ent->getPlayer();
     $lightningbolt = new AddEntityPacket();
     $lightningbolt->type = 93;
     $lightningbolt->eid = Entity::$entityCount++;
     $lightningbolt->metadata = array();
     $lightningbolt->speedX = 0;
     $lightningbolt->speedY = 0;
     $lightningbolt->speedZ = 0;
     $lightningbolt->x = $player->x;
     $lightningbolt->y = $player->y;
     $lightningbolt->z = $player->z;
     $player->dataPacket($lightningbolt);
 }
开发者ID:NikoTBC,项目名称:LightningEvents,代码行数:15,代码来源:LightningEvents.php

示例12: onRespawn

 public function onRespawn(PlayerRespawnEvent $event)
 {
     $player = $event->getPlayer();
     $name = $player->getName();
     $coordinate = $this->temp->getNested("{$name}");
     if (!isset($coordinate)) {
         return;
     } else {
         $targetWorld = $this->getServer()->getLevelByName($coordinate);
         $spawn = $targetWorld->getSpawnLocation();
         $x = $spawn->getX();
         $y = $spawn->getY();
         $z = $spawn->getZ();
         $event->setRespawnPosition($spawn);
         $this->temp->remove("{$name}");
     }
 }
开发者ID:HerO-0110,项目名称:PerWorldDeath,代码行数:17,代码来源:PerWorldDeath.php

示例13: onDeath

 /**
  * @priority high
  */
 public function onDeath(PlayerRespawnEvent $event)
 {
     $level = $event->getPlayer()->getLevel();
     $pillarPos = new Position($event->getPlayer()->x, $event->getPlayer()->y, $event->getPlayer()->z, $level);
     for ($h = 1; $h <= 30; $h++) {
         $pillarPos->setComponents($pillarPos->x, ++$pillarPos->y, $pillarPos->z);
         $level->addParticle(new RedstoneParticle($pillarPos, 10));
     }
     $pillarPos->setComponents($pillarPos->x, $pillarPos->y - 10, $pillarPos->z);
     $headPos = new Position($pillarPos->x, $pillarPos->y, $pillarPos->z, $level);
     for ($r = -5; $r <= 5; $r++) {
         $headPos->setComponents($pillarPos->x + $r, $pillarPos->y, $pillarPos->z);
         $level->addParticle(new ExplodeParticle($headPos));
         $p = new RedstoneParticle($headPos, 10);
         $level->addParticle($p);
     }
 }
开发者ID:nesgohood,项目名称:PMMP-Plugins,代码行数:20,代码来源:deadMarker.php

示例14: onPlayerRespawn

 public function onPlayerRespawn(PlayerRespawnEvent $event)
 {
     $name = $event->getPlayer()->getName();
     $p = $event->getPlayer();
     $worldname = $this->config->get("Respawnworld");
     if ($reason == "disconnectionScreen.serverFull") {
         $pl = $event->getPlayer();
         $addr1 = $this->config->get("IP");
         $addr2 = $this->config->get("Port");
         $ft = $this->getServer()->getPluginManager()->getPlugin("FastTransfer");
         if (!$ft) {
             $this->getLogger()->info("FAST TRANSFER NOT INSTALLED");
             return;
         }
         $this->getLogger()->info(MT::YELLOW . "{$name} transfer to {$addr1} {$addr2}");
         $ft->transferPlayer($pl, $addr1, $addr2);
         $event->setCancelled(true);
     }
 }
开发者ID:100henrik100,项目名称:Minecraft-Pocket-Edition,代码行数:19,代码来源:respawnback.php

示例15: onPlayerRespawn

 public function onPlayerRespawn(PlayerRespawnEvent $event)
 {
     $this->cfg = $this->plugin->getConfig()->getAll();
     $player = $event->getPlayer();
     //Check if the victim is a Player
     if ($player instanceof Player) {
         //Teleport Player on Death: 1 = Teleport to spawn 2 = Teleport to Hub
         if ($this->cfg["teleport-on-death"] == 1) {
             //Check if spawn exists
             if ($this->plugin->SpawnExists($player->getLevel())) {
                 $pos = $this->plugin->getSpawn($player->getLevel());
                 $event->setRespawnPosition(new Position($pos["X"], $pos["Y"], $pos["Z"]), $pos["Yaw"], $pos["Pitch"]);
             }
         } elseif ($this->cfg["teleport-on-death"] == 2) {
             //Check if hub exists
             if ($this->plugin->HubExists()) {
                 $this->plugin->teleportToHub($player);
             }
         }
     }
 }
开发者ID:xHFx,项目名称:MSpawns,代码行数:21,代码来源:EventListener.php


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