This commit is contained in:
Daniel Mills
2020-01-21 20:06:44 -05:00
parent fa1d2416e0
commit 9d5ae41c49
7 changed files with 26 additions and 29 deletions

View File

@@ -63,6 +63,7 @@ public class IrisGenerator extends ParallaxWorldGenerator
private boolean disposed;
private CNG scatter;
private CNG swirl;
private MB ICE = new MB(Material.ICE);
private MB PACKED_ICE = new MB(Material.PACKED_ICE);
private MB WATER = new MB(Material.STATIONARY_WATER);
@@ -121,6 +122,7 @@ public class IrisGenerator extends ParallaxWorldGenerator
}
random = new Random(world.getSeed());
rTerrain = new RNG(world.getSeed());
swirl = new CNG(rTerrain.nextParallelRNG(0), 40, 1).scale(0.012);
glLNoise = new GenLayerLayeredNoise(this, world, random, rTerrain.nextParallelRNG(2));
glBiome = new GenLayerBiome(this, world, random, rTerrain.nextParallelRNG(4), dim.getBiomes());
glSnow = new GenLayerSnow(this, world, random, rTerrain.nextParallelRNG(5));
@@ -174,14 +176,14 @@ public class IrisGenerator extends ParallaxWorldGenerator
return getDimension().getBiomeByName(name);
}
public double getOffsetX(double x)
public double getOffsetX(double x, double z)
{
return Math.round((double) x * (Iris.settings.gen.horizontalZoom / 1.90476190476));
return Math.round((double) x * (Iris.settings.gen.horizontalZoom / 1.90476190476)) + swirl.noise(x, z);
}
public double getOffsetZ(double z)
public double getOffsetZ(double x, double z)
{
return Math.round((double) z * (Iris.settings.gen.horizontalZoom / 1.90476190476));
return Math.round((double) z * (Iris.settings.gen.horizontalZoom / 1.90476190476)) - swirl.noise(z, x);
}
public IrisMetrics getMetrics()
@@ -331,8 +333,8 @@ public class IrisGenerator extends ParallaxWorldGenerator
return Biome.VOID;
}
double wx = getOffsetX(wxxf);
double wz = getOffsetZ(wzxf);
double wx = getOffsetX(wxxf, wzxf);
double wz = getOffsetZ(wxxf, wzxf);
int wxx = (int) wx;
int wzx = (int) wz;
int highest = 0;

View File

@@ -122,7 +122,7 @@ public class GenObjectDecorator extends BlockPopulator
{
int x = (cx << 4) + random.nextInt(16);
int z = (cz << 4) + random.nextInt(16);
IrisBiome biome = g.getBiome((int) g.getOffsetX(x), (int) g.getOffsetZ(z));
IrisBiome biome = g.getBiome((int) g.getOffsetX(x, z), (int) g.getOffsetZ(x, z));
if(hits.contains(biome))
{

View File

@@ -22,6 +22,7 @@ public class GenLayerBiome extends GenLayer
private GMap<String, IrisRegion> regions;
private Function<CNG, CNG> factory;
private CNG fracture;
private CNG fuzz;
private CNG island;
private BiomeLayer master;
@@ -32,8 +33,9 @@ public class GenLayerBiome extends GenLayer
island = new CNG(rng.nextParallelRNG(10334), 1D, 1)
.scale(0.003 * Iris.settings.gen.landScale)
.fractureWith(new CNG(rng.nextParallelRNG(1211), 1D, 1)
.scale(0.001 * Iris.settings.gen.landScale), 600);
fracture = new CNG(rng.nextParallelRNG(28), 1D, 4).scale(0.0021)
.scale(0.001 * Iris.settings.gen.landScale), 3600);
fuzz = new CNG(rng.nextParallelRNG(9112), 1D * 8 * Iris.settings.gen.biomeEdgeFuzzScale, 1).scale(6.5);
fracture = new CNG(rng.nextParallelRNG(28), 1D, 4).scale(0.0021 * Iris.settings.gen.biomeEdgeScrambleScale)
.fractureWith(new CNG(rng.nextParallelRNG(34), 1D, 2)
.scale(0.01), 12250);
factory = (g) -> g.fractureWith(new CNG(rng.nextParallelRNG(29), 1D, 3)
@@ -135,8 +137,10 @@ public class GenLayerBiome extends GenLayer
{
double wx = Math.round((double) wxx * (Iris.settings.gen.horizontalZoom / 1.90476190476)) * Iris.settings.gen.biomeScale;
double wz = Math.round((double) wzx * (Iris.settings.gen.horizontalZoom / 1.90476190476)) * Iris.settings.gen.biomeScale;
double x = wx + ((fracture.noise(wx, wz) / 2D) * 200D * Iris.settings.gen.biomeEdgeScrambleScale);
double z = wz - ((fracture.noise(wz, wx) / 2D) * 200D * Iris.settings.gen.biomeEdgeScrambleScale);
double x = wx + ((fracture.noise(wx, wz) / 2D) * 200D * Iris.settings.gen.biomeEdgeScrambleRange);
double z = wz - ((fracture.noise(wz, wx) / 2D) * 200D * Iris.settings.gen.biomeEdgeScrambleRange);
x -= fuzz.noise(wx, wz);
z += fuzz.noise(wz, wx);
if(real)
{