Update to latest Gaea, revert Erosion changes, update packaged config

This commit is contained in:
dfsek
2020-10-19 01:24:43 -07:00
parent 29fe4b9289
commit a5b75f4275
9 changed files with 11 additions and 9 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -111,9 +111,9 @@
<dependency> <dependency>
<groupId>org.polydev</groupId> <groupId>org.polydev</groupId>
<artifactId>gaea</artifactId> <artifactId>gaea</artifactId>
<version>1.12.1</version> <version>1.12.2</version>
<scope>system</scope> <scope>system</scope>
<systemPath>${basedir}/lib/Gaea-1.12.1.jar</systemPath> <systemPath>${basedir}/lib/Gaea-1.12.2.jar</systemPath>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
@@ -8,11 +8,11 @@ import org.polydev.gaea.math.FastNoiseLite;
public class ErosionNoise { public class ErosionNoise {
private final double thresh; private final double thresh;
private final FastNoiseLite noise; 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)); FastNoiseLite main = new FastNoiseLite((int) (seed+1));
main.setNoiseType(FastNoiseLite.NoiseType.OpenSimplex2); main.setNoiseType(FastNoiseLite.NoiseType.OpenSimplex2);
main.setFractalType(FastNoiseLite.FractalType.PingPong); main.setFractalType(FastNoiseLite.FractalType.FBm);
main.setFractalOctaves(1); main.setFractalOctaves(octaves);
main.setFrequency(freq1); main.setFrequency(freq1);
this.thresh = thresh; this.thresh = thresh;
this.noise = main; this.noise = main;
@@ -25,6 +25,7 @@ public class ErosionNoise {
* @return Whether location is eroded * @return Whether location is eroded
*/ */
boolean isEroded(int x, int z) { 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; private final BiomeZone zone;
public TerraBiomeGrid(World w, float freq1, float freq2, BiomeZone zone, ConfigPack c, UserDefinedGrid erosion) { 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) { if(c.biomeBlend) {
perturb = new CoordinatePerturb(c.blendFreq, c.blendAmp, w.getSeed()); perturb = new CoordinatePerturb(c.blendFreq, c.blendAmp, w.getSeed());
} }
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;
} }
} }
@@ -16,7 +16,6 @@ public class UserDefinedGrid extends BiomeGrid {
private final ImageLoader.Channel channelZ; private final ImageLoader.Channel channelZ;
public UserDefinedGrid(World w, float freq1, float freq2, UserDefinedBiome[][] b, WorldConfig c) { public UserDefinedGrid(World w, float freq1, float freq2, UserDefinedBiome[][] b, WorldConfig c) {
super(w, freq1, freq2, b.length, b[0].length); super(w, freq1, freq2, b.length, b[0].length);
super.setNormalType(NormalType.LOOKUP4096);
super.setGrid(b); super.setGrid(b);
imageLoader = c.imageLoader; imageLoader = c.imageLoader;
fromImage = c.fromImage; fromImage = c.fromImage;
@@ -61,6 +61,7 @@ public class ConfigPack extends YamlConfiguration {
public final float erosionFreq; public final float erosionFreq;
public final double erosionThresh; public final double erosionThresh;
public final boolean erosionEnable; public final boolean erosionEnable;
public final int erosionOctaves;
public final String erosionName; public final String erosionName;
public final int blendAmp; public final int blendAmp;
@@ -107,6 +108,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("erode.octaves", 3);
octaves = getInt("noise.octaves", 4); octaves = getInt("noise.octaves", 4);
frequency = (float) getDouble("noise.frequency", 1f/96); frequency = (float) getDouble("noise.frequency", 1f/96);