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


PHP Location::getLevel方法代碼示例

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


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

示例1: build

 public function build()
 {
     $materialMaxKey = count($this->floorMaterials) - 1;
     $level = $this->playerPrepLoc->getLevel();
     //		$level->getServer()->getLogger()->debug("Start rebuilding of spleef $this->name");
     for ($floor = 0; $floor < $this->floors; $floor++) {
         $y = $this->lowestY + $floor * $this->floorHeight;
         for ($x = $this->fromx; $x <= $this->tox; $x++) {
             for ($z = $this->fromz; $z <= $this->toz; $z++) {
                 $level->setBlock(new Vector3($x, $y, $z), $this->floorMaterials[mt_rand(0, $materialMaxKey)], false, false);
             }
         }
     }
     //		$level->getServer()->getLogger()->debug("Finished rebuilding of spleef $this->name");
 }
開發者ID:LegionPE,項目名稱:LegionPE-Eta,代碼行數:15,代碼來源:SpleefArenaConfig.php

示例2: createTouchEffect

 public function createTouchEffect(Location $position, $entityHeight, Location $damagerPosition, $damagerHeight)
 {
     if (isset($this->config["NU_EFFECT"]) && !$this->config["NU_EFFECT"]) {
         $position->getLevel()->addSound(new DoorSound($position));
         for ($i = 0; $i < 50; $i++) {
             $position->getLevel()->addParticle(new HeartParticle($position->add(mt_rand(-1, 1), mt_rand(-1, 1) + $entityHeight, mt_rand(-1, 1))));
         }
         for ($i = 0; $i < 50; $i++) {
             $damagerPosition->getLevel()->addParticle(new HeartParticle($damagerPosition->add(mt_rand(-1, 1), mt_rand(-1, 1) + $damagerHeight, mt_rand(-1, 1))));
         }
     } else {
         $position->getLevel()->addSound(new DoorSound($position));
         for ($i = 0; $i < 50; $i++) {
             $position->getLevel()->addParticle(new DustParticle($position->add(mt_rand(-1, 1) / 2, mt_rand(-1, 1) / 2 + $entityHeight, mt_rand(-1, 1) / 2), 153, 51, 255));
         }
         for ($i = 0; $i < 50; $i++) {
             $damagerPosition->getLevel()->addParticle(new DustParticle($damagerPosition->add(mt_rand(-1, 1) / 2, mt_rand(-1, 1) / 2 + $damagerHeight, mt_rand(-1, 1) / 2), 153, 51, 255));
         }
     }
 }
開發者ID:EpicArtz08999,項目名稱:ZombieGame,代碼行數:20,代碼來源:GameGenius.php

示例3: fromPosition

 public static function fromPosition($name, Location $pos)
 {
     return new BaseLocation($name, $pos->getX(), $pos->getY(), $pos->getZ(), $pos->getLevel(), $pos->getYaw(), $pos->getPitch());
 }
開發者ID:PrimusLV,項目名稱:EssentialsPE,代碼行數:4,代碼來源:BaseLocation.php

示例4: setHome

 /**
  * @param $home
  * @param Location $pos
  * @return bool
  */
 public function setHome($home, Location $pos)
 {
     if (!$this->getPlugin()->validateName($home, false)) {
         return false;
     }
     $this->homes[$home] = new BaseLocation($home, $pos->getX(), $pos->getY(), $pos->getZ(), $pos->getLevel(), $pos->getYaw(), $pos->getPitch());
     return true;
 }
開發者ID:ZencraftYouTube,項目名稱:EssentialsPE,代碼行數:13,代碼來源:BaseSession.php


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