Fixed unknown spawn, added start event

This commit is contained in:
Shoghi Cervantes Pueyo 2012-12-26 03:00:49 +01:00
parent 92c64db1b5
commit ea6fe8312a

View File

@ -231,7 +231,9 @@ class PocketMinecraftServer extends stdClass{
console("[INFO] Map: ".$this->level["LevelName"]);
$this->time = (int) $this->level["Time"];
$this->seed = (int) $this->level["RandomSeed"];
$this->spawn = array("x" => $this->level["SpawnX"], "y" => $this->level["SpawnY"], "z" => $this->level["SpawnZ"]);
if(isset($this->level["SpawnX"])){
$this->spawn = array("x" => $this->level["SpawnX"], "y" => $this->level["SpawnY"], "z" => $this->level["SpawnZ"]);
}
$this->level["Time"] = &$this->time;
console("[INFO] Spawn: X ".$this->level["SpawnX"]." Y ".$this->level["SpawnY"]." Z ".$this->level["SpawnZ"]);
console("[INFO] Time: ".$this->time);
@ -307,6 +309,7 @@ class PocketMinecraftServer extends stdClass{
declare(ticks=15);
register_tick_function(array($this, "tick"));
register_shutdown_function(array($this, "close"));
$this->trigger("server.start");
console("[INFO] Server started!");
$this->process();
}