This commit is contained in:
GameHerobrine 2023-11-06 16:02:41 +03:00
parent 69d5589191
commit 4b17c605b4
2 changed files with 2 additions and 2 deletions

View file

@ -350,7 +350,7 @@ class Utils{
}
public static function readShort($str, $signed = true){
if(strlen($str) === 0){
if(strlen($str) < 2){
return;
}

View file

@ -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;