本文整理汇总了PHP中pocketmine\Player::getFloorZ方法的典型用法代码示例。如果您正苦于以下问题:PHP Player::getFloorZ方法的具体用法?PHP Player::getFloorZ怎么用?PHP Player::getFloorZ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\Player
的用法示例。
在下文中一共展示了Player::getFloorZ方法的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;
}
}
示例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;
}
示例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();
}