noiseBase = new Simplex($this->random, 4, 1 / 4, 1 / 64); $this->random->setSeed($this->seed); $ores = new Ore(); $ores->setOreTypes([ new OreType(VanillaBlocks::NETHER_QUARTZ_ORE(), VanillaBlocks::NETHERRACK(), 16, 14, 10, 117) ]); $this->populators[] = $ores; } public function generateChunk(ChunkManager $world, int $chunkX, int $chunkZ) : void{ $this->random->setSeed(0xdeadbeef ^ ($chunkX << 8) ^ $chunkZ ^ $this->seed); $noise = $this->noiseBase->getFastNoise3D(16, 128, 16, 4, 8, 4, $chunkX * 16, 0, $chunkZ * 16); $chunk = $world->getChunk($chunkX, $chunkZ); $bedrock = VanillaBlocks::BEDROCK()->getFullId(); $netherrack = VanillaBlocks::NETHERRACK()->getFullId(); $stillLava = VanillaBlocks::LAVA()->getFullId(); for($x = 0; $x < 16; ++$x){ for($z = 0; $z < 16; ++$z){ $chunk->setBiomeId($x, $z, BiomeIds::HELL); for($y = 0; $y < 128; ++$y){ if($y === 0 or $y === 127){ $chunk->setFullBlock($x, $y, $z, $bedrock); continue; } $noiseValue = (abs($this->emptyHeight - $y) / $this->emptyHeight) * $this->emptyAmplitude - $noise[$x][$z][$y]; $noiseValue -= 1 - $this->density; if($noiseValue > 0){ $chunk->setFullBlock($x, $y, $z, $netherrack); }elseif($y <= $this->waterHeight){ $chunk->setFullBlock($x, $y, $z, $stillLava); } } } } foreach($this->generationPopulators as $populator){ $populator->populate($world, $chunkX, $chunkZ, $this->random); } } public function populateChunk(ChunkManager $world, int $chunkX, int $chunkZ) : void{ $this->random->setSeed(0xdeadbeef ^ ($chunkX << 8) ^ $chunkZ ^ $this->seed); foreach($this->populators as $populator){ $populator->populate($world, $chunkX, $chunkZ, $this->random); } $chunk = $world->getChunk($chunkX, $chunkZ); $biome = BiomeRegistry::getInstance()->getBiome($chunk->getBiomeId(7, 7)); $biome->populateChunk($world, $chunkX, $chunkZ, $this->random); } }