OpenMinecraft.Biome.NeedsSnowAndIce C# (CSharp) Method

NeedsSnowAndIce() public static method

public static NeedsSnowAndIce ( BiomeType biomeType ) : bool
biomeType BiomeType
return bool
        public static bool NeedsSnowAndIce(BiomeType biomeType)
        {
            switch (biomeType)
            {
                case BiomeType.Taiga:
                case BiomeType.Tundra:
                    return true;
                default:
                    return false;
            }
        }

Usage Example

Example #1
0
        internal virtual void Precipitate(ref byte[, ,] b, BiomeType[,] bt, MapGenMaterials mats, long X, long Z)
        {
            int xs = b.GetLength(0);
            int zs = b.GetLength(2);

            for (int x = 0; x < xs; x++)
            {
                for (int z = 0; z < zs; z++)
                {
                    if (Biome.NeedsSnowAndIce(bt[x, z]))
                    {
                        continue;
                    }
                    // Fall down
                    for (int y = b.GetLength(1) - 1; y > 0; y--)
                    {
                        byte block = b[x, y, z];
                        if (block == 0)
                        {
                            continue;
                        }
                        if (block == mats.Water)
                        {
                            b[x, y, z] = mats.Ice;
                        }
                        else
                        {
                            b[x, y + 1, z] = mats.Snow;
                        }
                        break;
                    }
                }
            }
        }