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


PHP Player::getFloorX方法代码示例

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


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

示例1: isInArea

 public function isInArea(Player $player, $area)
 {
     if ($player->getFloorX() >= $area['pos1'['x']] && $player->getFloorX() <= $area['pos2'['x']] && $player->getFloorY() >= $area['pos1'['y']] && $player->getFloorY() <= $area['pos2'['y']] && $player->getFloorZ() >= $area['pos1'['z']] && $player->getFloorZ() <= $area['pos2'['y']] && $area['level'] == $player->getLevel()) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:Rspuds,项目名称:AreaEffects,代码行数:8,代码来源:Main.php

示例2: unJail

 private function unJail(Player $player)
 {
     /*--Get player coords and ground coords--*/
     $px = round($player->getX());
     $py = round($player->getY());
     $pz = round($player->getZ());
     $gx = round($player->getFloorX());
     $gy = round($player->getFloorY());
     $gz = round($player->getFloorZ());
     $level = $player->getLevel();
     /*--Define the position of the 16 blocks around the player--*/
     $pos1 = new Vector3($px + 1, $py, $pz);
     $pos2 = new Vector3($px + 1, $py, $pz + 1);
     $pos3 = new Vector3($px - 1, $py, $pz + 1);
     $pos4 = new Vector3($px + 1, $py, $pz - 1);
     $pos5 = new Vector3($px, $py, $pz + 1);
     $pos6 = new Vector3($px - 1, $py, $pz);
     $pos7 = new Vector3($px, $py, $pz - 1);
     $pos8 = new Vector3($px - 1, $py + 1, $pz - 1);
     $pos9 = new Vector3($px + 1, $py + 1, $pz);
     $pos10 = new Vector3($px + 1, $py + 1, $pz + 1);
     $pos11 = new Vector3($px - 1, $py + 1, $pz + 1);
     $pos12 = new Vector3($px + 1, $py + 1, $pz - 1);
     $pos13 = new Vector3($px, $py + 1, $pz + 1);
     $pos14 = new Vector3($px - 1, $py + 1, $pz);
     $pos15 = new Vector3($px, $py + 1, $pz - 1);
     $pos16 = new Vector3($px - 1, $py + 1, $pz - 1);
     /*--And remove the blocks of bedrock--*/
     $this->getServer()->getLevel($level)->setBlock($pos1, Block::get(0, 0));
     $this->getServer()->getLevel($level)->setBlock($pos2, Block::get(0, 0));
     $this->getServer()->getLevel($level)->setBlock($pos3, Block::get(0, 0));
     $this->getServer()->getLevel($level)->setBlock($pos4, Block::get(0, 0));
     $this->getServer()->getLevel($level)->setBlock($pos5, Block::get(0, 0));
     $this->getServer()->getLevel($level)->setBlock($pos6, Block::get(0, 0));
     $this->getServer()->getLevel($level)->setBlock($pos7, Block::get(0, 0));
     $this->getServer()->getLevel($level)->setBlock($pos8, Block::get(0, 0));
     $this->getServer()->getLevel($level)->setBlock($pos9, Block::get(0, 0));
     $this->getServer()->getLevel($level)->setBlock($pos10, Block::get(0, 0));
     $this->getServer()->getLevel($level)->setBlock($pos11, Block::get(0, 0));
     $this->getServer()->getLevel($level)->setBlock($pos12, Block::get(0, 0));
     $this->getServer()->getLevel($level)->setBlock($pos13, Block::get(0, 0));
     $this->getServer()->getLevel($level)->setBlock($pos14, Block::get(0, 0));
     $this->getServer()->getLevel($level)->setBlock($pos15, Block::get(0, 0));
     $this->getServer()->getLevel($level)->setBlock($pos16, Block::get(0, 0));
     /*--Break the blocks under and above the player--*/
     $this->getServer()->getLevel($level)->setBlock(new Vector3($px, $py + 2, $pz), Block::get(0, 0));
     $this->getServer()->getLevel($level)->setBlock(new Vector3($gx, $gy, $gz), Block::get(0, 0));
     return true;
 }
开发者ID:EmreTr1,项目名称:PunishPE,代码行数:49,代码来源:Main.php

示例3: onJoin

 public function onJoin()
 {
     foreach ($this->player->getLevel()->getChunkPlayers($this->player->getFloorX() >> 4, $this->player->getFloorZ() >> 4) as $other) {
         $other->hidePlayer($this->player);
         $this->invisibleFrom[$other->getId()] = true;
     }
     $this->prepareLogin();
 }
开发者ID:Addison118,项目名称:LegionPE-Theta-Base,代码行数:8,代码来源:Session.php


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