9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-25 10:09:14 +00:00
This commit is contained in:
Daniel Mills
2020-11-01 10:14:50 -05:00
parent 7a7fee1d8a
commit cfc8458841
5 changed files with 43 additions and 15 deletions

View File

@@ -59,6 +59,11 @@ public class GenLayerBiome extends GenLayer
return null;
}
if(!iris.getDimension().getFocusRegion().trim().isEmpty())
{
return iris.loadRegion(iris.getDimension().getFocusRegion());
}
return regionGenerator.fitRarity(iris.getDimension().getAllRegions(iris), bx, bz);
}

View File

@@ -239,6 +239,11 @@ public class IrisDimension extends IrisRegistrant
@Desc("Keep this either undefined or empty. Setting any biome name into this will force iris to only generate the specified biome. Great for testing.")
private String focus = "";
@RegistryListBiome
@DontObfuscate
@Desc("Keep this either undefined or empty. Setting any region name into this will force iris to only generate the specified region. Great for testing.")
private String focusRegion = "";
@MinNumber(0.0001)
@MaxNumber(512)
@DontObfuscate

View File

@@ -41,6 +41,10 @@ public class IrisGenerator extends IrisRegistrant
@Desc("The opacity, essentially a multiplier on the output.")
private double opacity = 1;
@DontObfuscate
@Desc("Multiply the compsites instead of adding them")
private boolean multiplicitive = false;
@MinNumber(0.001)
@DontObfuscate
@Desc("The size of the cell fractures")
@@ -252,15 +256,24 @@ public class IrisGenerator extends IrisRegistrant
int hc = (int) ((cliffHeightMin * 10) + 10 + cliffHeightMax * seed + offsetX + offsetZ);
double h = 0;
double tp = 0;
double tp = multiplicitive ? 1 : 0;
for(IrisNoiseGenerator i : composite)
{
tp += i.getOpacity();
h += i.getNoise(seed + superSeed + hc, (rx + offsetX) / zoom, (rz + offsetZ) / zoom);
if(multiplicitive)
{
tp *= i.getOpacity();
h *= i.getNoise(seed + superSeed + hc, (rx + offsetX) / zoom, (rz + offsetZ) / zoom);
}
else
{
tp += i.getOpacity();
h += i.getNoise(seed + superSeed + hc, (rx + offsetX) / zoom, (rz + offsetZ) / zoom);
}
}
double v = (h / tp) * opacity;
double v = multiplicitive ? h * opacity : (h / tp) * opacity;
if(Double.isNaN(v))
{

View File

@@ -13,5 +13,10 @@ public abstract class GenLayer
this.rng = rng;
}
public GenLayer()
{
this(null, null);
}
public abstract double generate(double x, double z);
}