diff --git a/Pocket/plugins/Mineplex/src/mineplex/plugin/gameengine/game/components/spawn/SimpleSpawnComponent.php b/Pocket/plugins/Mineplex/src/mineplex/plugin/gameengine/game/components/spawn/SimpleSpawnComponent.php index 29a0ecf59..d9ab860a0 100644 --- a/Pocket/plugins/Mineplex/src/mineplex/plugin/gameengine/game/components/spawn/SimpleSpawnComponent.php +++ b/Pocket/plugins/Mineplex/src/mineplex/plugin/gameengine/game/components/spawn/SimpleSpawnComponent.php @@ -44,15 +44,18 @@ class SimpleSpawnComponent implements SpawnComponent, Listener { print "WorldLoadSuccessEvent!"; if ($event->getArena() !== $this->arena) return; - $this->spawns = UtilArray::getValuesRecursively($this->worldComponent->getTeams()); - foreach ($this->spawns as $key => $value) - { - if (!($value instanceof Position)) - unset($this->spawns[$key]); - } + $this->spawns = $this->worldComponent->getTeams()['Green']; - print (count($this->spawns) . " spawns Loaded\n"); +// $this->spawns = UtilArray::getValuesRecursively($this->worldComponent->getTeams()); +// +// foreach ($this->spawns as $key => $value) +// { +// if (!($value instanceof Position)) +// unset($this->spawns[$key]); +// } +// +// print (count($this->spawns) . " spawns Loaded\n"); } @@ -80,12 +83,9 @@ class SimpleSpawnComponent implements SpawnComponent, Listener { Main::sendLoc($player); $pos = $this->spawns[array_rand($this->spawns)]; - $pos = $pos->getLevel()->getSpawnLocation(); + //$pos = $pos->getLevel()->getSpawnLocation(); - print "\nX: " . $pos->getX(); - print "\nY: " . $pos->getY(); - print "\nZ: " . $pos->getZ(); - print "\nLevel: " . $pos->getLevel()->getName(); + print_r($pos); $player->teleport($pos); diff --git a/Pocket/plugins/Mineplex/src/mineplex/plugin/gameengine/game/components/world/WorldComponent.php b/Pocket/plugins/Mineplex/src/mineplex/plugin/gameengine/game/components/world/WorldComponent.php index 9adf81edd..093732b04 100644 --- a/Pocket/plugins/Mineplex/src/mineplex/plugin/gameengine/game/components/world/WorldComponent.php +++ b/Pocket/plugins/Mineplex/src/mineplex/plugin/gameengine/game/components/world/WorldComponent.php @@ -145,7 +145,7 @@ class WorldComponent implements Listener public function loadWorldData() { - $handle = fopen("WorldConfig.dat", "r"); + $handle = fopen('worlds/' . $this->worldNameFolder . '/WorldConfig.dat', "r"); if ($handle) { //These store the array that data should be inserted into @@ -155,7 +155,9 @@ class WorldComponent implements Listener while (($line = fgets($handle)) !== false) { - $tokens = explode(":", $line); + $trimmedLine = trim($line, "\n\r"); + + $tokens = explode(":", $trimmedLine); if (count($tokens) < 2 || strlen($tokens[0]) == 0) {