本文整理汇总了PHP中pocketmine\level\Position::__toString方法的典型用法代码示例。如果您正苦于以下问题:PHP Position::__toString方法的具体用法?PHP Position::__toString怎么用?PHP Position::__toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\level\Position
的用法示例。
在下文中一共展示了Position::__toString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseArenaPositions
/**
* Create arenas
*/
public function parseArenaPositions(array $arenaPositions)
{
foreach ($arenaPositions as $n => $arenaPosition) {
Server::getInstance()->loadLevel($arenaPosition[3]);
if (($level = Server::getInstance()->getLevelByName($arenaPosition[3])) === null) {
Server::getInstance()->getLogger()->error("[1vs1] - " . $arenaPosition[3] . " is not loaded. Arena " . $n . " is disabled.");
} else {
$newArenaPosition = new Position($arenaPosition[0], $arenaPosition[1], $arenaPosition[2], $level);
$newArena = new Arena($newArenaPosition, $this);
array_push($this->arenas, $newArena);
Server::getInstance()->getLogger()->debug("[1vs1] - Arena " . $n . " loaded at position " . $newArenaPosition->__toString());
}
}
}
示例2: __toString
public function __toString()
{
return "Weak" . parent::__toString();
}
示例3: parseBlockData
/**
*
*/
public function parseBlockData()
{
$this->blocks = [];
foreach ($this->config->get("blocks") as $i => $block) {
if ($this->getServer()->isLevelLoaded($block["level"])) {
$pos = new Position($block["x"], $block["y"], $block["z"], $this->getServer()->getLevelByName($block["level"]));
if (isset($block["name"])) {
$this->blocks[$pos->__toString()] = new Block($pos, $block["commands"], $this, $block["name"]);
} else {
$this->blocks[$block["x"] . ":" . $block["y"] . ":" . $block["z"] . ":" . $block["level"]] = new Block($pos, $block["commands"], $this, $i);
}
} else {
$this->getLogger()->warning("Could not load block in level " . $block["level"] . " because that level is not loaded.");
}
}
}