mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
Update to latest Gaea, revert Erosion changes, update packaged config
This commit is contained in:
@@ -8,11 +8,11 @@ import org.polydev.gaea.math.FastNoiseLite;
|
||||
public class ErosionNoise {
|
||||
private final double thresh;
|
||||
private final FastNoiseLite noise;
|
||||
public ErosionNoise(float freq1, double thresh, long seed) {
|
||||
public ErosionNoise(float freq1, double thresh, int octaves, long seed) {
|
||||
FastNoiseLite main = new FastNoiseLite((int) (seed+1));
|
||||
main.setNoiseType(FastNoiseLite.NoiseType.OpenSimplex2);
|
||||
main.setFractalType(FastNoiseLite.FractalType.PingPong);
|
||||
main.setFractalOctaves(1);
|
||||
main.setFractalType(FastNoiseLite.FractalType.FBm);
|
||||
main.setFractalOctaves(octaves);
|
||||
main.setFrequency(freq1);
|
||||
this.thresh = thresh;
|
||||
this.noise = main;
|
||||
@@ -25,6 +25,7 @@ public class ErosionNoise {
|
||||
* @return Whether location is eroded
|
||||
*/
|
||||
boolean isEroded(int x, int z) {
|
||||
return (noise.getNoise(x, z)+1)/2 <= thresh;
|
||||
double abs = Math.pow(noise.getNoise(x, z), 2);
|
||||
return abs < thresh;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,13 +21,13 @@ public class TerraBiomeGrid extends BiomeGrid {
|
||||
private final BiomeZone zone;
|
||||
|
||||
public TerraBiomeGrid(World w, float freq1, float freq2, BiomeZone zone, ConfigPack c, UserDefinedGrid erosion) {
|
||||
super(w, freq1, freq2);
|
||||
super(w, freq1, freq2, 0, 0);
|
||||
if(c.biomeBlend) {
|
||||
perturb = new CoordinatePerturb(c.blendFreq, c.blendAmp, w.getSeed());
|
||||
}
|
||||
this.zone = zone;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ public class UserDefinedGrid extends BiomeGrid {
|
||||
private final ImageLoader.Channel channelZ;
|
||||
public UserDefinedGrid(World w, float freq1, float freq2, UserDefinedBiome[][] b, WorldConfig c) {
|
||||
super(w, freq1, freq2, b.length, b[0].length);
|
||||
super.setNormalType(NormalType.LOOKUP4096);
|
||||
super.setGrid(b);
|
||||
imageLoader = c.imageLoader;
|
||||
fromImage = c.fromImage;
|
||||
|
||||
@@ -61,6 +61,7 @@ public class ConfigPack extends YamlConfiguration {
|
||||
public final float erosionFreq;
|
||||
public final double erosionThresh;
|
||||
public final boolean erosionEnable;
|
||||
public final int erosionOctaves;
|
||||
public final String erosionName;
|
||||
|
||||
public final int blendAmp;
|
||||
@@ -107,6 +108,7 @@ public class ConfigPack extends YamlConfiguration {
|
||||
erosionEnable = getBoolean("erode.enable", false);
|
||||
erosionFreq = (float) getDouble("erode.frequency", 0.01);
|
||||
erosionThresh = getDouble("erode.threshold", 0.04);
|
||||
erosionOctaves = getInt("erode.octaves", 3);
|
||||
|
||||
octaves = getInt("noise.octaves", 4);
|
||||
frequency = (float) getDouble("noise.frequency", 1f/96);
|
||||
|
||||
Reference in New Issue
Block a user