本文整理汇总了PHP中pocketmine\block\Block::GetY方法的典型用法代码示例。如果您正苦于以下问题:PHP Block::GetY方法的具体用法?PHP Block::GetY怎么用?PHP Block::GetY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\block\Block
的用法示例。
在下文中一共展示了Block::GetY方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DestroyBlock
public function DestroyBlock(Block $Block, Player $Destroyer)
{
$X = $Block->GetX();
$Y = $Block->GetY();
$Z = $Block->GetZ();
if ($Team = $this->getTeamByPlayer($Destroyer)) {
if ($X == $Team->Bed[0]->getX() && $Y == $Team->Bed[0]->getY() && $Z == $Team->Bed[0]->getZ() || $X == $Team->Bed[1]->getX() && $Y == $Team->Bed[1]->getY() && $Z == $Team->Bed[1]->getZ()) {
return true;
}
}
foreach ($this->Teams as $name => $Team) {
if ($X == $Team->Bed[0]->getX() && $Y == $Team->Bed[0]->getY() && $Z == $Team->Bed[0]->getZ() || $X == $Team->Bed[1]->getX() && $Y == $Team->Bed[1]->getY() && $Z == $Team->Bed[1]->getZ()) {
$Team->BedStatus = 0;
$this->sendMessageToAll(TextFormat::RED . $this->plugin->getMessage("bedwars.team.destroyed", $name));
$this->updateTeams();
$this->Level->setBlock(new Vector3($Team->Bed[0]->getX(), $Team->Bed[0]->getY(), $Team->Bed[0]->getZ()), Block::get(0), true, true);
$this->Level->setBlock(new Vector3($Team->Bed[1]->getX(), $Team->Bed[1]->getY(), $Team->Bed[1]->getZ()), Block::get(0), true, true);
return false;
}
}
foreach ($this->BlocksPlaced as $Block) {
if ($X == $Block->getX() && $Y == $Block->getY() && $Z == $Block->getZ()) {
return false;
}
}
return true;
}