diff --git a/src/pmf/PMFLevel.php b/src/pmf/PMFLevel.php index 9b0c7425..008cd203 100644 --- a/src/pmf/PMFLevel.php +++ b/src/pmf/PMFLevel.php @@ -192,7 +192,7 @@ class PMFLevel extends PMF{ public function getBiomeId($x, $z){ $X = $x >> 4; $Z = $z >> 4; - $index = self::getIndex($X, $Z); + $index = $this->getIndex($X, $Z); if(!isset($this->chunkInfo[$index])){ return 0; } @@ -205,7 +205,7 @@ class PMFLevel extends PMF{ public function setBiomeId($x, $z, $id){ $X = $x >> 4; $Z = $z >> 4; - $index = self::getIndex($X, $Z); + $index = $this->getIndex($X, $Z); if(!isset($this->chunks[$index])){ return 0; } @@ -311,7 +311,7 @@ class PMFLevel extends PMF{ public function loadChunk($X, $Z){ - $index = self::getIndex($X, $Z); + $index = $this->getIndex($X, $Z); if($this->isChunkLoaded($X, $Z)){ return true; @@ -359,10 +359,11 @@ class PMFLevel extends PMF{ $this->chunkChange[$index][-1] = true; $this->chunkChange[$index][$Y] = 16384; $this->locationTable[$index][0] |= 1 << $Y; + $this->chunkInfo[$index][0] = str_repeat("\x00", 256); return true; } public function initCleanChunk($X, $Z){ - $index = self::getIndex($X, $Z); + $index = $this->getIndex($X, $Z); if(!isset($this->chunks[$index])){ $this->chunks[$index] = array( 0 => false, diff --git a/src/world/Level.php b/src/world/Level.php index 883c805f..5e3f88d6 100644 --- a/src/world/Level.php +++ b/src/world/Level.php @@ -112,10 +112,10 @@ class Level{ $orderedData = ""; $orderedSkyLight = ""; //str_repeat("\xff", 16*16*64); $orderedLight = ""; //str_repeat("\xff", 16*16*64); - $orderedBiomeIds = $this->level->chunkInfo[$this->level->getIndex($X, $Z)][0]; + $orderedBiomeIds = ""; // $orderedBiomeColors = str_repeat("\x00\x85\xb2\x4a", 256); // also PM 1.4 $tileEntities = ""; - if($gen)$this->level->generateChunk($X, $Z, $this->generator); + if($gen) $this->level->generateChunk($X, $Z, $this->generator); if(!$this->level->isChunkLoaded($X, $Z)){ $this->level->loadChunk($X, $Z); } @@ -124,7 +124,7 @@ class Level{ for($y = 0; $y < 8; ++$y){ $miniChunks[$y] = $gen ? $this->level->getMiniChunk($X, $Z, $y) : str_repeat("\x00", 8192); } - + $orderedBiomeIds = $this->level->chunkInfo[$this->level->getIndex($X, $Z)][0]; for ($i = 0; $i < 16; $i++){ for ($j = 0; $j < 16; $j++){