syntax xd

This commit is contained in:
kotyara 2023-06-16 16:55:50 +05:00
parent 58626eeb95
commit 84dd0b82b3
5 changed files with 20 additions and 20 deletions

View file

@ -38,7 +38,7 @@ class BiomeSource
$f = 1 - (((($this->detailNoises[$index] * 1.1) + 0.5) * 0.01) + ((($this->temperatureNoises[$index] * 0.15) + 0.7) * 0.99));
$f1 = 1 - ($f*$f);
if($f1 < 0) $f1 = 0;
else if($f1 > 1) $f1 = 1;
elseif($f1 > 1) $f1 = 1;
$this->temperatureNoises[$index++] = $f1;
}
@ -66,10 +66,10 @@ class BiomeSource
$blockTemp = 1 - ($f1 * $f1);
if($blockTemp < 0) $blockTemp = 0;
else if($blockTemp > 1) $blockTemp = 1;
elseif($blockTemp > 1) $blockTemp = 1;
if($rain < 0) $rain = 0;
else if($rain > 1) $rain = 1;
elseif($rain > 1) $rain = 1;
$this->temperatureNoises[$index] = $blockTemp;
$this->rainfallNoises[$index] = $rain;

View file

@ -108,12 +108,12 @@ class VanillaGenerator implements LevelGenerator
$sample = (int) (((($this->treeNoise->getValue($chunkXWorld * 0.5, $chunkZWorld * 0.5) / 8) + ($this->rand->nextFloat() * 4)) + 4) / 3);
$treesAmount = $this->rand->nextInt(10) == 0;
if($biome == Biome::$forest) $treesAmount += $sample + 2;
else if($biome == Biome::$rainForest) $treesAmount += $sample + 2;
else if($biome == Biome::$seasonalForest) $treesAmount += $sample + 1;
else if($biome == Biome::$taiga) $treesAmount += $sample + 1;
else if($biome == Biome::$desert) $treesAmount -= 20;
else if($biome == Biome::$tundra) $treesAmount -= 20;
else if($biome == Biome::$plains) $treesAmount -= 20;
elseif($biome == Biome::$rainForest) $treesAmount += $sample + 2;
elseif($biome == Biome::$seasonalForest) $treesAmount += $sample + 1;
elseif($biome == Biome::$taiga) $treesAmount += $sample + 1;
elseif($biome == Biome::$desert) $treesAmount -= 20;
elseif($biome == Biome::$tundra) $treesAmount -= 20;
elseif($biome == Biome::$plains) $treesAmount -= 20;
for($l8 = 0; $l8 < $treesAmount; ++$l8){
$l12 = $chunkXWorld + $this->rand->nextInt(16) + 8;
$j15 = $chunkZWorld + $this->rand->nextInt(16) + 8;
@ -237,7 +237,7 @@ class VanillaGenerator implements LevelGenerator
$b3 = ord($chunks[$blockY >> 4][($blockY & 0xf) + ($blockZ << 5) + ($blockX << 9)]);
if($b3 == 0){
$i = -1;
}else if($b3 == STONE){
}elseif($b3 == STONE){
if($i == -1){
if($nextFloat > 0){
if($blockY >= 64-4 && $blockY <= 64+1){
@ -266,7 +266,7 @@ class VanillaGenerator implements LevelGenerator
}else{
$chunks[$blockY >> 4][($blockY & 0xf) + ($blockZ << 5) + ($blockX << 9)] = chr($b2);
}
}else if($i > 0){
}elseif($i > 0){
--$i;
$chunks[$blockY >> 4][($blockY & 0xf) + ($blockZ << 5) + ($blockX << 9)] = chr($b2);
if($i == 0 && $b2 == SAND){
@ -396,7 +396,7 @@ class VanillaGenerator implements LevelGenerator
$d12 = ($this->interpolationNoises[$k1] / 10 + 1) / 2;
if($d12 < 0) $d8 = $d10;
else if($d12 > 1) $d8 = $d11;
elseif($d12 > 1) $d8 = $d11;
else $d8 = $d10 + ($d11 - $d10) * $d12;
$d8 -= $d9;