本文整理汇总了PHP中pocketmine\level\Position::getBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP Position::getBlock方法的具体用法?PHP Position::getBlock怎么用?PHP Position::getBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\level\Position
的用法示例。
在下文中一共展示了Position::getBlock方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateSigns
public function updateSigns()
{
$this->plugin->storage->signs->reload();
foreach ($this->plugin->storage->signs->getAll() as $sign) {
$signloc = $this->plugin->storage->signs->get($sign . ".location");
$locx = new Position($signloc->getX() - 0.5, $signloc->getY(), $signloc->getZ() - 0.5, $signloc->getLevel());
if ($locx->getBlock()->getID() == Item::SIGN_POST || $loc->getBlock()->getID() == Item::WALL_SIGN) {
$signblock = $locx->getBlock();
$lines = $signblock->getLines();
if (strpos($sign, "leave")) {
$signLines = $this->plugin->config->get('sign')['LEAVE'];
$linecount = 0;
foreach ($signLines as $line) {
if ($linecount <= 3) {
$signblock->setLine($linecount, MessageM::replaceAll($line));
}
$linecount++;
}
$signblock->update();
} else {
$linecount;
if (strpos($sign, "shop")) {
$signLines = $this->plugin->config->get('sign')['SHOP'];
$linecount = 0;
foreach ($signLines as $line) {
if ($linecount <= 3) {
$signblock->setLine($linecount, MessageM::replaceAll($line));
}
$linecount++;
}
$signblock->update();
} else {
foreach ($this->plugin->storage->arenaList as $arena) {
if (substr($lines[1], -strlen($arena->arenaName)) === $arena->arenaName) {
if ($arena::gameState == ArenaState::WAITING) {
$signLines = $this->plugin->config->get('sign')['WAITING'];
$linecount = 0;
if ($signLines != null) {
foreach ($signLines as $line) {
if ($linecount <= 3) {
$signblock->setLine($linecount, MessageM::replaceAll($line, ["arenaname-" . $arena->arenaName, "players-" . count($arena->playersInArena), "maxplayers-" . $arena->maxPlayers, "timeleft-" . $arena->timer]));
}
$linecount++;
}
}
$signblock->update();
} else {
if ($arena::gameState == ArenaState::STARTING) {
$signLines = $this->plugin->config->get('sign')['STARTING'];
$linecount = 0;
if ($signLines != null) {
foreach ($signLines as $line) {
if (linecount <= 3) {
$signblock->setLine($linecount, MessageM::replaceAll($line, ["arenaname-" . $arena->arenaName, "players-" . count($arena->playersInArena), "maxplayers-" . $arena->maxPlayers, "timeleft-" . $arena->timer]));
}
$linecount++;
}
}
$signblock->update();
} else {
if ($arena::gameState == ArenaState::INGAME) {
$signLines = $this->plugin->config->get('sign')['INGAME'];
$linecount = 0;
if ($signLines != null) {
foreach ($signLines as $line) {
if ($linecount <= 3) {
$signblock->setLine($linecount, MessageM::replaceAll($line, ["arenaname-" . $arena->arenaName, "players-" . count($arena->playersInArena), "maxplayers-" . $arena->maxPlayers, "timeleft-" . $arena->timer]));
}
$linecount++;
}
}
$signblock->update();
}
}
}
}
}
}
}
} else {
removeSign($loc);
}
}
}