mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-11 14:05:35 +00:00
Flat: use a less dumb way to build biome array
This commit is contained in:
parent
9835d75f65
commit
401e8d117b
@ -25,6 +25,7 @@ namespace pocketmine\world\generator;
|
|||||||
|
|
||||||
use pocketmine\block\VanillaBlocks;
|
use pocketmine\block\VanillaBlocks;
|
||||||
use pocketmine\world\ChunkManager;
|
use pocketmine\world\ChunkManager;
|
||||||
|
use pocketmine\world\format\BiomeArray;
|
||||||
use pocketmine\world\format\Chunk;
|
use pocketmine\world\format\Chunk;
|
||||||
use pocketmine\world\format\SubChunk;
|
use pocketmine\world\format\SubChunk;
|
||||||
use pocketmine\world\generator\object\OreType;
|
use pocketmine\world\generator\object\OreType;
|
||||||
@ -68,14 +69,7 @@ class Flat extends Generator{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function generateBaseChunk() : void{
|
protected function generateBaseChunk() : void{
|
||||||
$this->chunk = new Chunk();
|
$this->chunk = new Chunk([], BiomeArray::fill($this->options->getBiomeId()));
|
||||||
|
|
||||||
$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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$structure = $this->options->getStructure();
|
$structure = $this->options->getStructure();
|
||||||
$count = count($structure);
|
$count = count($structure);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user