Config refactoring, work on caverns, multi-level tree gen

This commit is contained in:
dfsek
2020-10-04 21:14:58 -07:00
parent c80e65cce9
commit 277fbccc07
34 changed files with 328 additions and 110 deletions

View File

@@ -57,9 +57,17 @@ public class SimplexCarver extends Carver {
double mainNoise = noise.getNoise(x, z)*2;
double columnNoise = Math.pow(Math.max(column.getNoise(x, z), 0)*2, 3);
double hc = (acot(16*(hasCaves.getNoise(x, z)-0.2))/Math.PI)-0.1;
CarvingData.CarvingType type = CarvingData.CarvingType.BOTTOM;
double simplex = (Math.pow(mainNoise + root2inverse, 3)/2 + columnNoise) * hc;
for(int y = 0; y < 64; y++) {
double finalNoise = (-0.05*Math.abs(y-(heightNoise*16 + 24))+1 - (Math.pow(mainNoise + root2inverse, 3)/2 + columnNoise)) * hc;
if(finalNoise > 0.5) c.carve(x-ox, y, z-oz, CarvingData.CarvingType.CENTER);
double finalNoise = (-0.05*Math.abs(y-(heightNoise*16 + 24))+1 - simplex) * hc;
if(finalNoise > 0.5) {
c.carve(x-ox, y, z-oz, type);
double finalNoiseUp = (-0.05*Math.abs((y+1)-(heightNoise*16 + 24))+1 - simplex) * hc;
if(finalNoiseUp > 0.5) {
type = CarvingData.CarvingType.CENTER;
} else type = CarvingData.CarvingType.TOP;
}
}
}
}

View File

@@ -1,7 +1,7 @@
package com.dfsek.terra.carving;
import com.dfsek.terra.TerraWorld;
import com.dfsek.terra.config.ConfigPack;
import com.dfsek.terra.config.base.ConfigPack;
import org.polydev.gaea.math.Range;
import com.dfsek.terra.biome.UserDefinedBiome;
import org.bukkit.World;