mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-08-30 05:40:34 +00:00
Configurable erosion octaves
This commit is contained in:
@@ -8,10 +8,10 @@ import org.polydev.gaea.math.FastNoise;
|
|||||||
public class ErosionNoise {
|
public class ErosionNoise {
|
||||||
private final double thresh;
|
private final double thresh;
|
||||||
private final FastNoise noise;
|
private final FastNoise noise;
|
||||||
public ErosionNoise(float freq1, double thresh, long seed) {
|
public ErosionNoise(float freq1, double thresh, int octaves, long seed) {
|
||||||
FastNoise main = new FastNoise((int) (seed+1));
|
FastNoise main = new FastNoise((int) (seed+1));
|
||||||
main.setNoiseType(FastNoise.NoiseType.SimplexFractal);
|
main.setNoiseType(FastNoise.NoiseType.SimplexFractal);
|
||||||
main.setFractalOctaves(3);
|
main.setFractalOctaves(octaves);
|
||||||
main.setFrequency(freq1);
|
main.setFrequency(freq1);
|
||||||
this.thresh = thresh;
|
this.thresh = thresh;
|
||||||
this.noise = main;
|
this.noise = main;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public class TerraBiomeGrid extends BiomeGrid {
|
|||||||
}
|
}
|
||||||
this.zone = zone;
|
this.zone = zone;
|
||||||
if(c.erosionEnable) {
|
if(c.erosionEnable) {
|
||||||
erode = new ErosionNoise(c.erosionFreq, c.erosionThresh, w.getSeed());
|
erode = new ErosionNoise(c.erosionFreq, c.erosionThresh, c.erosionOctaves, w.getSeed());
|
||||||
this.erosionGrid = erosion;
|
this.erosionGrid = erosion;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,20 +52,21 @@ public class ConfigPack extends YamlConfiguration {
|
|||||||
|
|
||||||
private final String id;
|
private final String id;
|
||||||
|
|
||||||
public List<String> biomeList;
|
public final List<String> biomeList;
|
||||||
|
|
||||||
public float zoneFreq;
|
public final float zoneFreq;
|
||||||
public float freq1;
|
public final float freq1;
|
||||||
public float freq2;
|
public final float freq2;
|
||||||
|
|
||||||
public float erosionFreq;
|
public final float erosionFreq;
|
||||||
public double erosionThresh;
|
public final double erosionThresh;
|
||||||
public boolean erosionEnable;
|
public final int erosionOctaves;
|
||||||
public String erosionName;
|
public final boolean erosionEnable;
|
||||||
|
public final String erosionName;
|
||||||
|
|
||||||
public int blendAmp;
|
public final int blendAmp;
|
||||||
public boolean biomeBlend;
|
public final boolean biomeBlend;
|
||||||
public float blendFreq;
|
public final float blendFreq;
|
||||||
|
|
||||||
public ConfigPack(File file) throws IOException, InvalidConfigurationException {
|
public ConfigPack(File file) throws IOException, InvalidConfigurationException {
|
||||||
long l = System.nanoTime();
|
long l = System.nanoTime();
|
||||||
@@ -104,6 +105,7 @@ public class ConfigPack extends YamlConfiguration {
|
|||||||
erosionEnable = getBoolean("erode.enable", false);
|
erosionEnable = getBoolean("erode.enable", false);
|
||||||
erosionFreq = (float) getDouble("erode.frequency", 0.01);
|
erosionFreq = (float) getDouble("erode.frequency", 0.01);
|
||||||
erosionThresh = getDouble("erode.threshold", 0.04);
|
erosionThresh = getDouble("erode.threshold", 0.04);
|
||||||
|
erosionOctaves = getInt("erosion.octaves", 4);
|
||||||
|
|
||||||
erosionName = getString("erode.grid");
|
erosionName = getString("erode.grid");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user