Flat: use a less dumb way to build biome array

This commit is contained in:
Dylan K. Taylor 2021-10-25 20:15:33 +01:00
parent 9835d75f65
commit 401e8d117b
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -25,6 +25,7 @@ namespace pocketmine\world\generator;
use pocketmine\block\VanillaBlocks;
use pocketmine\world\ChunkManager;
use pocketmine\world\format\BiomeArray;
use pocketmine\world\format\Chunk;
use pocketmine\world\format\SubChunk;
use pocketmine\world\generator\object\OreType;
@ -68,14 +69,7 @@ class Flat extends Generator{
}
protected function generateBaseChunk() : void{
$this->chunk = new Chunk();
$biomeId = $this->options->getBiomeId();
for($Z = 0; $Z < Chunk::EDGE_LENGTH; ++$Z){
for($X = 0; $X < Chunk::EDGE_LENGTH; ++$X){
$this->chunk->setBiomeId($X, $Z, $biomeId);
}
}
$this->chunk = new Chunk([], BiomeArray::fill($this->options->getBiomeId()));
$structure = $this->options->getStructure();
$count = count($structure);