__toString() public méthode

public __toString ( )
 /**
  * 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());
         }
     }
 }
Exemple #2
0
 public function __toString()
 {
     return "Weak" . parent::__toString();
 }
Exemple #3
0
 /**
  *
  */
 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.");
         }
     }
 }