    001    package net.minecraft.src;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005
    006    @SideOnly(Side.CLIENT)
    007    public class ColorizerFoliage
    008    {
    009        /** Color buffer for foliage */
    010        private static int[] foliageBuffer = new int[65536];
    011
    012        public static void getFoilageBiomeColorizer(int[] par0ArrayOfInteger)
    013        {
    014            foliageBuffer = par0ArrayOfInteger;
    015        }
    016
    017        /**
    018         * Gets foliage color from temperature and humidity. Args: temperature, humidity
    019         */
    020        public static int getFoliageColor(double par0, double par2)
    021        {
    022            par2 *= par0;
    023            int var4 = (int)((1.0D - par0) * 255.0D);
    024            int var5 = (int)((1.0D - par2) * 255.0D);
    025            return foliageBuffer[var5 << 8 | var4];
    026        }
    027
    028        /**
    029         * Gets the foliage color for pine type (metadata 1) trees
    030         */
    031        public static int getFoliageColorPine()
    032        {
    033            return 6396257;
    034        }
    035
    036        /**
    037         * Gets the foliage color for birch type (metadata 2) trees
    038         */
    039        public static int getFoliageColorBirch()
    040        {
    041            return 8431445;
    042        }
    043
    044        public static int getFoliageColorBasic()
    045        {
    046            return 4764952;
    047        }
    048    }