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

Cave Biomes

This commit is contained in:
Daniel Mills
2020-07-28 03:13:33 -04:00
parent 45dd039c53
commit bccb4e154d
12 changed files with 479 additions and 106 deletions

View File

@@ -50,11 +50,21 @@ public class CellGenerator
public float getValue(double x, double z, int possibilities)
{
if(possibilities == 1)
{
return 0;
}
return ((fn.GetCellular((float) ((x * cellScale) + (cng.noise(x, z) * shuffle)), (float) ((z * cellScale) + (cng.noise(z, x) * shuffle))) + 1f) / 2f) * (possibilities - 1);
}
public int getIndex(double x, double z, int possibilities)
{
if(possibilities == 1)
{
return 0;
}
return (int) Math.round(getValue(x, z, possibilities));
}
}