diff --git a/src/API/ServerAPI.php b/src/API/ServerAPI.php index 914c54324..d937c305e 100644 --- a/src/API/ServerAPI.php +++ b/src/API/ServerAPI.php @@ -125,7 +125,9 @@ class ServerAPI{ } $this->server = new PocketMinecraftServer($this->getProperty("server-name"), $this->getProperty("gamemode"), false, $this->getProperty("server-port"), $this->getProperty("server-id"), $this->getProperty("server-ip")); self::$serverRequest = $this->server; - $this->setProperty("server-id", $this->server->serverID); + if($this->getProperty("server-id") != $this->server->serverID){ + $this->setProperty("server-id", $this->server->serverID); + } $this->server->api = $this; $gitsha1 = false; if(file_exists(FILE_PATH.".git/refs/heads/master")){ //Found Git information! @@ -205,7 +207,7 @@ class ServerAPI{ $this->gen->generate(); $this->gen->save($this->server->mapDir, $this->server->mapName); $this->setProperty("level-name", $this->server->mapName); - $this->setProperty("gamemode", 1); + $this->setProperty("gamemode", CREATIVE); } $this->loadProperties(); $this->server->loadMap(); diff --git a/src/utils/Utils.php b/src/utils/Utils.php index 2a1ea264f..c6ccb8b1a 100644 --- a/src/utils/Utils.php +++ b/src/utils/Utils.php @@ -346,12 +346,6 @@ class Utils{ return array("yaw" => $hAngle, "pitch" => $vAngle); } - /*public static function sha1($input){ - $number = new Math_BigInteger(sha1($input, true), -256); - $zero = new Math_BigInteger(0); - return ($zero->compare($number) <= 0 ? "":"-") . ltrim($number->toHex(), "0"); - }*/ - public static function microtime(){ return microtime(true); }