9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-31 04:46:40 +00:00
This commit is contained in:
Daniel Mills
2020-08-02 16:17:02 -04:00
parent 7863660a47
commit b6592582b3
8 changed files with 99 additions and 15 deletions

View File

@@ -6,7 +6,7 @@ public enum Dispersion
{
@DontObfuscate
SCATTER,
@DontObfuscate
WISPY,
WISPY;
}

View File

@@ -176,7 +176,7 @@ public class IrisDepositGenerator
int x = rng.i(af, bf);
int z = rng.i(af, bf);
int height = (int) (Math.round(g.getTerrainWaterHeight(x, z))) - 5;
int height = (int) (Math.round(g.getTerrainWaterHeight(x, z))) - 2;
if(height <= 0)
{
@@ -204,7 +204,7 @@ public class IrisDepositGenerator
int ny = j.getBlockY() + h;
int nz = j.getBlockZ() + z;
if(nx > 15 || nx < 0 || ny > 255 || ny < 0 || nz < 0 || nz > 15)
if(ny > height || nx > 15 || nx < 0 || ny > 255 || ny < 0 || nz < 0 || nz > 15)
{
continue;
}

View File

@@ -23,6 +23,10 @@ public class IrisRegionRidge
@Desc("What type this spot is (i.e. target SEA but as LAND) like an island. Default matches the target type")
private InferredType as = InferredType.DEFER;
@DontObfuscate
@Desc("Use the distance from cell value to add or remove noise value. (Forces depth or height)")
private double noiseMultiplier = 0;
@DontObfuscate
@Desc("The chance this biome will be placed in a given spot")
private double chance = 0.75;
@@ -47,6 +51,10 @@ public class IrisRegionRidge
@Desc("The thickness of the vein")
private double thickness = 0.125;
@DontObfuscate
@Desc("If the noise multiplier is below zero, what should the air be filled with?")
private IrisBiomePaletteLayer air = new IrisBiomePaletteLayer().zero();
private transient CellGenerator spot;
private transient CellGenerator ridge;
@@ -55,6 +63,30 @@ public class IrisRegionRidge
}
public double getRidgeHeight(RNG rng, double x, double z)
{
if(getNoiseMultiplier() == 0)
{
return 0;
}
if(ridge == null)
{
ridge = new CellGenerator(rng.nextParallelRNG((int) (465583 * getChance())));
ridge.setCellScale(scale);
ridge.setShuffle(shuffle);
}
if(spot == null)
{
spot = new CellGenerator(rng.nextParallelRNG((int) (198523 * getChance())));
spot.setCellScale(chanceScale);
spot.setShuffle(shuffle);
}
return spot.getDistance(x, z) * ridge.getDistance(x, z) * getNoiseMultiplier();
}
public boolean isRidge(RNG rng, double x, double z)
{
if(ridge == null)

View File

@@ -23,6 +23,10 @@ public class IrisRegionSpot
@Desc("What type this spot is (i.e. target SEA but as LAND) like an island. Default matches the target type")
private InferredType as = InferredType.DEFER;
@DontObfuscate
@Desc("Use the distance from cell value to add or remove noise value. (Forces depth or height)")
private double noiseMultiplier = 0;
@DontObfuscate
@Desc("The scale of splotches")
private double scale = 1;
@@ -35,6 +39,10 @@ public class IrisRegionSpot
@Desc("The shuffle or how natural the splotch looks like (anti-polygon)")
private double shuffle = 128;
@DontObfuscate
@Desc("If the noise multiplier is below zero, what should the air be filled with?")
private IrisBiomePaletteLayer air = new IrisBiomePaletteLayer().zero();
private transient CellGenerator spot;
public IrisRegionSpot()
@@ -42,6 +50,23 @@ public class IrisRegionSpot
}
public double getSpotHeight(RNG rng, double x, double z)
{
if(getNoiseMultiplier() == 0)
{
return 0;
}
if(spot == null)
{
spot = new CellGenerator(rng.nextParallelRNG((int) (168583 * (shuffle + 102) + rarity + (scale * 10465) + biome.length() + type.ordinal() + as.ordinal())));
spot.setCellScale(scale);
spot.setShuffle(shuffle);
}
return spot.getDistance(x, z) * getNoiseMultiplier();
}
public boolean isSpot(RNG rng, double x, double z)
{
if(spot == null)