/// <summary>
        /// Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
        /// when first determining what to render.
        /// </summary>
        public override int ColorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
        {
            int i = par1IBlockAccess.GetBlockMetadata(par2, par3, par4);

            if ((i & 3) == 1)
            {
                return(ColorizerFoliage.GetFoliageColorPine());
            }

            if ((i & 3) == 2)
            {
                return(ColorizerFoliage.GetFoliageColorBirch());
            }

            int j = 0;
            int k = 0;
            int l = 0;

            for (int i1 = -1; i1 <= 1; i1++)
            {
                for (int j1 = -1; j1 <= 1; j1++)
                {
                    int k1 = par1IBlockAccess.GetBiomeGenForCoords(par2 + j1, par4 + i1).GetBiomeFoliageColor();
                    j += (k1 & 0xff0000) >> 16;
                    k += (k1 & 0xff00) >> 8;
                    l += k1 & 0xff;
                }
            }

            return((j / 9 & 0xff) << 16 | (k / 9 & 0xff) << 8 | l / 9 & 0xff);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
        /// when first determining what to render.
        /// </summary>
        public override int ColorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
        {
            if (BlockMaterial == Material.Water)
            {
                int i = 0;
                int j = 0;
                int k = 0;

                for (int l = -1; l <= 1; l++)
                {
                    for (int i1 = -1; i1 <= 1; i1++)
                    {
                        int j1 = par1IBlockAccess.GetBiomeGenForCoords(par2 + i1, par4 + l).WaterColorMultiplier;
                        i += (j1 & 0xff0000) >> 16;
                        j += (j1 & 0xff00) >> 8;
                        k += j1 & 0xff;
                    }
                }

                return((i / 9 & 0xff) << 16 | (j / 9 & 0xff) << 8 | k / 9 & 0xff);
            }
            else
            {
                return(0xffffff);
            }
        }
        /// <summary>
        /// Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
        /// when first determining what to render.
        /// </summary>
        public override int ColorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
        {
            int i = par1IBlockAccess.GetBlockMetadata(par2, par3, par4);

            if (i == 0)
            {
                return(0xffffff);
            }
            else
            {
                return(par1IBlockAccess.GetBiomeGenForCoords(par2, par4).GetBiomeGrassColor());
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
 /// when first determining what to render.
 /// </summary>
 public override int ColorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
 {
     return(par1IBlockAccess.GetBiomeGenForCoords(par2, par4).GetBiomeFoliageColor());
 }