mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Made flat-world generation faster and less stupid
No need to set blocks which are obviously already going to be air >_>
This commit is contained in:
parent
8a28dfa64d
commit
c9fdb66c78
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user