本文整理汇总了PHP中pocketmine\math\Vector3::getFloorY方法的典型用法代码示例。如果您正苦于以下问题:PHP Vector3::getFloorY方法的具体用法?PHP Vector3::getFloorY怎么用?PHP Vector3::getFloorY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\math\Vector3
的用法示例。
在下文中一共展示了Vector3::getFloorY方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLocByVector
public function getLocByVector(Vector3 $block, $levelFolderName)
{
return $block->getFloorX() . ";" . $block->getFloorY() . ";" . $block->getFloorZ() . ";" . $levelFolderName;
}
示例2: 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();
}
示例3: 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;
}
示例4: 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);
}
}
}
}
}
}
}