/// <summary> /// Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false, /// don't check biomeCache to avoid infinite loop in BiomeCacheBlock) /// </summary> public virtual BiomeGenBase[] GetBiomeGenAt(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5, bool par6) { IntCache.ResetIntCache(); if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.Length < par4 * par5) { par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5]; } if (par6 && par4 == 16 && par5 == 16 && (par2 & 0xf) == 0 && (par3 & 0xf) == 0) { BiomeGenBase[] abiomegenbase = BiomeCache.GetCachedBiomes(par2, par3); Array.Copy(abiomegenbase, 0, par1ArrayOfBiomeGenBase, 0, par4 * par5); return(par1ArrayOfBiomeGenBase); } int[] ai = BiomeIndexLayer.GetInts(par2, par3, par4, par5); for (int i = 0; i < par4 * par5; i++) { par1ArrayOfBiomeGenBase[i] = BiomeGenBase.BiomeList[ai[i]]; } return(par1ArrayOfBiomeGenBase); }
/// <summary> /// Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length. /// </summary> public virtual float[] GetRainfall(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5) { IntCache.ResetIntCache(); if (par1ArrayOfFloat == null || par1ArrayOfFloat.Length < par4 * par5) { par1ArrayOfFloat = new float[par4 * par5]; } int[] ai = BiomeIndexLayer.GetInts(par2, par3, par4, par5); for (int i = 0; i < par4 * par5; i++) { float f = (float)BiomeGenBase.BiomeList[ai[i]].GetIntRainfall() / 65536F; if (f > 1.0F) { f = 1.0F; } par1ArrayOfFloat[i] = f; } return(par1ArrayOfFloat); }
/// <summary> /// Returns an array of biomes for the location input. /// </summary> public virtual BiomeGenBase[] GetBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5) { IntCache.ResetIntCache(); if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.Length < par4 * par5) { par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5]; } int[] ai = GenBiomes.GetInts(par2, par3, par4, par5); for (int i = 0; i < par4 * par5; i++) { par1ArrayOfBiomeGenBase[i] = BiomeGenBase.BiomeList[ai[i]]; } return(par1ArrayOfBiomeGenBase); }