9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-29 12:09:07 +00:00

Decor Updates

- Fixed decorators using the same RNG when picking from a pool of blocks as it used to place it. This caused it to only use pool entries above the placement chance threshold. (E.g. a flower pool with a 0.15 chance to place will only use the first 0.15 of the pool of flowers since the RNG is the same)
- Removed `zoom`, `verticalZoom` and `varianceZoom` properties from decorators. Zooms can be done inside the individual styles instead.
- WIP Tab Completion (Create command only rn)

Dev notes:
It's very important from now on that in decorators, the X and Z remain switched when getting noise so that the result of the noise is not exactly the same as the noise that choose if the decor should be placed or not
This commit is contained in:
StrangeOne101
2021-07-09 23:21:55 +12:00
parent b4f866be03
commit f1dfb1c952
5 changed files with 89 additions and 42 deletions

View File

@@ -18,6 +18,10 @@ public enum DecorationPart
@DontObfuscate
SEA_SURFACE,
@Desc("Targets the sea floor (entire placement must be bellow sea level)")
@DontObfuscate
SEA_FLOOR,
@Desc("Decorates on cave & carving ceilings or underside of overhangs")
@DontObfuscate
CEILING,

View File

@@ -54,22 +54,6 @@ public class IrisDecorator
@Desc("The maximum repeat stack height")
private int stackMax = 1;
@MinNumber(0.0001)
@DontObfuscate
@Desc("The zoom is for zooming in or out wispy dispersions. Makes patches bigger the higher this zoom value is")
private double zoom = 1;
@MinNumber(0.0001)
@DontObfuscate
@Desc("The zoom is for zooming in or out variance. Makes patches have more or less of one type.")
private double varianceZoom = 1;
@DependsOn({"stackMin", "stackMax"})
@MinNumber(0.0001)
@DontObfuscate
@Desc("The vertical zoom is for wispy stack heights. Zooming this in makes stack heights more slowly change over a distance")
private double verticalZoom = 1;
@Required
@MinNumber(0)
@MaxNumber(1)
@@ -101,7 +85,7 @@ public class IrisDecorator
return stackMin;
}
return getHeightGenerator(rng, data).fit(stackMin, stackMax, x / verticalZoom, z / verticalZoom);
return getHeightGenerator(rng, data).fit(stackMin, stackMax, x / heightVariance.getZoom(), z / heightVariance.getZoom());
}
public CNG getHeightGenerator(RNG rng, IrisDataManager data)
@@ -123,7 +107,7 @@ public class IrisDecorator
variance.create(
rng.nextParallelRNG((int) (getBlockData(data).size())))
.scale(1D / varianceZoom));
.scale(1D / variance.getZoom()));
}
public KList<IrisBlockData> add(String b)
@@ -140,8 +124,8 @@ public class IrisDecorator
return null;
}
double xx = x / getZoom();
double zz = z / getZoom();
double xx = x / style.getZoom();
double zz = z / style.getZoom();
if(getGenerator(rng, data).fitDouble(0D, 1D, xx, zz) <= chance)
{
@@ -150,7 +134,7 @@ public class IrisDecorator
return getBlockData(data).get(0);
}
return getVarianceGenerator(rng, data).fit(getBlockData(data), xx, zz);
return getVarianceGenerator(rng, data).fit(getBlockData(data), zz, xx); //X and Z must be switched
}
return null;
@@ -169,8 +153,8 @@ public class IrisDecorator
if(!getVarianceGenerator(rng, data).isStatic())
{
xx = x / getZoom();
zz = z / getZoom();
xx = x / style.getZoom();
zz = z / style.getZoom();
}
if(getBlockData(data).size() == 1)
@@ -178,7 +162,7 @@ public class IrisDecorator
return getBlockData(data).get(0);
}
return getVarianceGenerator(rng, data).fit(getBlockData(data), xx, zz).clone();
return getVarianceGenerator(rng, data).fit(getBlockData(data), zz, xx).clone(); //X and Z must be switched
}
public BlockData getBlockDataForTop(IrisBiome b, RNG rng, double x, double z, IrisDataManager data)
@@ -188,8 +172,8 @@ public class IrisDecorator
return null;
}
double xx = x / getZoom();
double zz = z / getZoom();
double xx = x / style.getZoom();
double zz = z / style.getZoom();
if(getGenerator(rng, data).fitDouble(0D, 1D, xx, zz) <= chance)
{
@@ -198,7 +182,7 @@ public class IrisDecorator
return getBlockDataTops(data).get(0);
}
return getVarianceGenerator(rng, data).fit(getBlockDataTops(data), xx, zz);
return getVarianceGenerator(rng, data).fit(getBlockDataTops(data), zz, xx); //X and Z must be switched
}
return null;