public byte GenerateBiome(int seed, IBiomeRepository biomes, Coordinates2D location, bool spawn) { double temp = Math.Abs(TempNoise.Value2D(location.X, location.Z)); double rainfall = Math.Abs(RainNoise.Value2D(location.X, location.Z)); byte ID = biomes.GetBiome(temp, rainfall, spawn).ID; return(ID); }
private Biome GetBiome(float x, float z) { x /= CoordinateScale; z /= CoordinateScale; var mX = x + BiomeModifierX.GetValue(x, z); var mZ = z + BiomeModifierZ.GetValue(x, z); var temp = TempNoise.GetValue(mX, mZ) * 3.024F; var rain = RainNoise.GetValue(mX, mZ); if (temp < -1f) { temp = -(temp % 1); } if (rain < 0) { rain = -rain; } return(BiomeUtils.GetBiome(temp, rain)); }