diff --git a/src/pmf/PMFLevel.php b/src/pmf/PMFLevel.php index 008cd203..3ff149d3 100644 --- a/src/pmf/PMFLevel.php +++ b/src/pmf/PMFLevel.php @@ -206,7 +206,7 @@ class PMFLevel extends PMF{ $X = $x >> 4; $Z = $z >> 4; $index = $this->getIndex($X, $Z); - if(!isset($this->chunks[$index])){ + if(!isset($this->chunkInfo[$index])){ return 0; } $aX = $x & 15; @@ -254,7 +254,9 @@ class PMFLevel extends PMF{ $chunk = @gzopen($this->getChunkPath($X, $Z), "wb" . PMF_LEVEL_DEFLATE_LEVEL); $bitmap = 0; - gzwrite($chunk, $this->chunkInfo[$index][0]); + $biomedata = $this->chunkInfo[$index][0]; + if(strlen($biomedata) < 256) $biomedata = str_repeat("\x01", 256); + gzwrite($chunk, $biomedata); for($Y = 0; $Y < $this->levelData["height"]; ++$Y){ if($this->chunks[$index][$Y] !== false and ((isset($this->chunkChange[$index][$Y]) and $this->chunkChange[$index][$Y] === 0) or !$this->isMiniChunkEmpty($X, $Z, $Y))){ gzwrite($chunk, $this->chunks[$index][$Y]); diff --git a/src/world/Level.php b/src/world/Level.php index 5e3f88d6..1d1b8298 100644 --- a/src/world/Level.php +++ b/src/world/Level.php @@ -447,6 +447,7 @@ class Level{ if(!isset($this->level)){ return false; } + if(strlen($data) != 16384) console(strlen($data)); $this->changedCount[$X . ":" . $Y . ":" . $Z] = 4096; if(ADVANCED_CACHE == true){ Cache::remove("world:{$this->name}:$X:$Z");