diff --git a/src/utils/Utils.php b/src/utils/Utils.php index 2b7e14e5..1ce039ee 100644 --- a/src/utils/Utils.php +++ b/src/utils/Utils.php @@ -350,7 +350,7 @@ class Utils{ } public static function readShort($str, $signed = true){ - if(strlen($str) === 0){ + if(strlen($str) < 2){ return; } diff --git a/src/world/Level.php b/src/world/Level.php index b65a49e3..1da06491 100644 --- a/src/world/Level.php +++ b/src/world/Level.php @@ -351,7 +351,7 @@ class Level{ $index = $this->level->getIndex($cX, $cZ); if(!isset($this->level->chunks[$index]) || $this->level->chunks[$index] === false) continue; for($c = 0; $c <= 20; ++$c){ - $xyz = mt_rand(0, 0xffffffff) >> 2;//TODO fix php5 + $xyz = mt_rand(0, 0xffffffff) >> 2; $x = $xyz & 0xf; $z = ($xyz >> 8) & 0xf; //TODO might be possible to make some micro optmizations $y = ($xyz >> 16) & 0x7f;