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


PHP Vector3::getFloorX方法代码示例

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


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

示例1: getLocByVector

 public function getLocByVector(Vector3 $block, $levelFolderName)
 {
     return $block->getFloorX() . ";" . $block->getFloorY() . ";" . $block->getFloorZ() . ";" . $levelFolderName;
 }
开发者ID:JungHyun3459,项目名称:PMMP-Plugins,代码行数:4,代码来源:SpeedBlock.php

示例2: sendWaypointMessage

 /**
  * @param CommandSender $sender
  * @param Vector3 $waypoint
  * @param int $index
  * @return bool
  */
 public function sendWaypointMessage(CommandSender $sender, Vector3 $waypoint, $index)
 {
     $this->sendMessage($sender, "message-waypoint-info", ["index" => $index, "x" => $waypoint->getFloorX(), "y" => $waypoint->getFloorY(), "z" => $waypoint->getFloorZ()]);
     return true;
 }
开发者ID:Artide,项目名称:Cameraman,代码行数:11,代码来源:Cameraman.php

示例3: canBlockSeeSky

 public function canBlockSeeSky(Vector3 $pos) : bool
 {
     return $this->getHighestBlockAt($pos->getFloorX(), $pos->getFloorZ()) < $pos->getY();
 }
开发者ID:kniffo80,项目名称:Genisys,代码行数:4,代码来源:Level.php

示例4: createTNT

 /**
  * @param Vector3|Position $pos
  * @param null|Level $level
  */
 public function createTNT(Vector3 $pos, Level $level = null)
 {
     if ($level === null) {
         if ($pos instanceof Position) {
             $level = $pos->getLevel();
         } else {
             return;
         }
     }
     $mot = (new Random())->nextSignedFloat() * M_PI * 2;
     $entity = Entity::createEntity("PrimedTNT", $level->getChunk($pos->x >> 4, $pos->z >> 4), new Compound("EssNuke", ["Pos" => new Enum("Pos", [new DoubleTag("", $pos->getFloorX() + 0.5), new DoubleTag("", $pos->getFloorY()), new DoubleTag("", $pos->getFloorZ() + 0.5)]), "Motion" => new Enum("Motion", [new DoubleTag("", -sin($mot) * 0.02), new DoubleTag("", 0.2), new DoubleTag("", -cos($mot) * 0.02)]), "Rotation" => new Enum("Rotation", [new FloatTag("", 0), new FloatTag("", 0)]), "Fuse" => new ByteTag("Fuse", 80)]));
     $entity->spawnToAll();
 }
开发者ID:mwvent,项目名称:WattzEssentialsPE,代码行数:17,代码来源:Loader.php

示例5: place

 public function place()
 {
     for ($x = $this->start->getFloorX(); $x < $this->end->getFloorX(); $x++) {
         $xOffset = ($this->chunk->getX() + $x + 0.5 - $this->target->getX()) / $this->horizontalSize;
         for ($z = $this->start->getFloorZ(); $z < $this->end->getFloorZ(); $z++) {
             $zOffset = ($this->chunk->getZ() + $z + 0.5 - $this->target->getZ()) / $this->horizontalSize;
             if ($xOffset * $xOffset + $zOffset * $zOffset >= 1) {
                 continue;
             }
             for ($y = $this->end->getFloorY() - 1; $y >= $this->start->getFloorY(); $y--) {
                 $yOffset = ($y + 0.5 - $this->target->getY()) / $this->verticalSize;
                 if ($yOffset > -0.7 and $xOffset * $xOffset + $yOffset * $yOffset + $zOffset * $zOffset < 1) {
                     $xx = $this->chunk->getX() + $x;
                     $zz = $this->chunk->getZ() + $z;
                     $blockId = $this->level->getBlockIdAt($xx, $y, $zz);
                     if ($blockId == Block::STONE or $blockId == Block::DIRT or $blockId == Block::GRASS) {
                         if ($y < 10) {
                             $this->level->setBlockIdAt($xx, $y, $zz, Block::STILL_LAVA);
                         } else {
                             if ($blockId == Block::GRASS and $this->level->getBlockIdAt($xx, $y - 1, $zz) == Block::DIRT) {
                                 $this->level->setBlockIdAt($xx, $y - 1, $zz, Block::GRASS);
                             }
                             $this->level->setBlockIdAt($xx, $y, $zz, Block::AIR);
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:iTXTech,项目名称:Genisys,代码行数:30,代码来源:Cave.php

示例6: addCustomEntity

 /**
  * @param string|Entity|CustomEntity $class
  * @param Vector3 $spawnPos
  * @param $data
  */
 public function addCustomEntity($class, Vector3 $spawnPos, $data)
 {
     $key = Level::chunkHash($spawnPos->getFloorX() >> 4, $spawnPos->getFloorZ() >> 4);
     $id = $this->nextId++;
     $this->locs[$key][$id] = new RegisteredSpawn($spawnPos->x, $spawnPos->y, $spawnPos->z, $id, $class, $data);
 }
开发者ID:legoboy0215,项目名称:LegionPE-Theta-Base,代码行数:11,代码来源:CustomEntityManager.php


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