92 $this->random->setSeed(0xa6fe78dc ^ ($chunkX << 8) ^ $chunkZ ^ $this->level->getSeed());
96 $chunk = $this->level->getChunk($chunkX, $chunkZ);
98 for ($x = 0; $x < 16; ++$x) {
99 for ($z = 0; $z < 16; ++$z) {
102 $biome->setGroundCover([
106 $chunk->setBiomeId($x, $z, $biome->getId());
109 $color[0] += (($bColor >> 16) ** 2);
110 $color[1] += ((($bColor >> 8) & 0xff) ** 2);
111 $color[2] += (($bColor & 0xff) ** 2);
115 for ($y = 0; $y < 128; ++$y) {
117 $noiseValue = (abs($this->emptyHeight - $y) / $this->emptyHeight) * $this->emptyAmplitude - $noise[$x][$z][$y];
118 $noiseValue -= 1 - $this->density;
120 $distance =
new Vector3(0, 64, 0);
121 $distance = $distance->distance(
new Vector3($chunkX * 16 + $x, ($y / 1.3), $chunkZ * 16 + $z));
123 if ($noiseValue < 0 && $distance < 100 or $noiseValue < -0.2 && $distance > 400) {
130 foreach ($this->generationPopulators as $populator) {
131 $populator->populate($this->level, $chunkX, $chunkZ, $this->random);