    001package net.minecraft.world;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005
    006@SideOnly(Side.CLIENT)
    007public class ColorizerFoliage
    008{
    009    /** Color buffer for foliage */
    010    private static int[] foliageBuffer = new int[65536];
    011
    012    public static void setFoliageBiomeColorizer(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 i = (int)((1.0D - par0) * 255.0D);
    024        int j = (int)((1.0D - par2) * 255.0D);
    025        return foliageBuffer[j << 8 | i];
    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}