diff --git a/src/pocketmine/level/generator/Flat.php b/src/pocketmine/level/generator/Flat.php index 1e83974b7..73080e4ba 100644 --- a/src/pocketmine/level/generator/Flat.php +++ b/src/pocketmine/level/generator/Flat.php @@ -112,24 +112,18 @@ class Flat extends Generator{ $this->floorLevel = $y = count($this->structure); - for(; $y < 0xFF; ++$y){ - $this->structure[$y] = [0, 0]; - } - - $this->chunk = clone $this->level->getChunk($chunkX, $chunkZ); $this->chunk->setGenerated(); for($Z = 0; $Z < 16; ++$Z){ for($X = 0; $X < 16; ++$X){ $this->chunk->setBiomeId($X, $Z, $biome); - for($y = 0; $y < 128; ++$y){ + for($y = 0; $y < 256 and isset($this->structure[$y]); ++$y){ $this->chunk->setBlock($X, $y, $Z, ...$this->structure[$y]); } } } - preg_match_all('#(([0-9a-z_]{1,})\(?([0-9a-z_ =:]{0,})\)?),?#', $options, $matches); foreach($matches[2] as $i => $option){ $params = true;