// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode fieldsfirst 

package net.minecraft.server;

import java.util.Random;

// Referenced classes of package net.minecraft.src:
//            Block, Material, World, BlockGrass, 
//            mod_decor, Item, AxisAlignedBB

public class flRed extends Block
{

    protected flRed(int i, int j)
    {
        super(i, Material.PLANT);
        textureId = j;
        a(true);
        float f = 0.2F;
        a(0.0F, 0.0F, 0.0F, 1.0F, 0.55F, 1.0F);
    }

    public boolean canPlace(World world, int i, int j, int k)
    {
        return super.canPlace(world, i, j, k) && canThisPlantGrowOnThisBlockID(world.getTypeId(i, j - 1, k));
    }

    protected boolean canThisPlantGrowOnThisBlockID(int i)
    {
        return i == Block.GRASS.id || i == Block.DIRT.id || i == Block.SOIL.id;
    }

    public void doPhysics(World world, int i, int j, int k, int l)
    {
        super.doPhysics(world, i, j, k, l);
        checkFlowerChange(world, i, j, k);
    }

    public void a(World world, int i, int j, int k, Random random)
    {
        checkFlowerChange(world, i, j, k);
    }

    protected final void checkFlowerChange(World world, int i, int j, int k)
    {
        if(!f(world, i, j, k))
        {
            b(world, i, j, k, world.getData(i, j, k), 0);
            world.setTypeId(i, j, k, 0);
        }
    }

    public int getDropType(int i, Random random, int j)
    {
        return mod_decor.flredItem.id;
    }

    public boolean f(World world, int i, int j, int k)
    {
        return (world.k(i, j, k) >= 8 || world.isChunkLoaded(i, j, k)) && canThisPlantGrowOnThisBlockID(world.getTypeId(i, j - 1, k));
    }

    public AxisAlignedBB e(World world, int i, int j, int k)
    {
        return null;
    }

    public boolean a()
    {
        return false;
    }

    public boolean renderAsNormalBlock()
    {
        return false;
    }

    public int c()
    {
        return 6;
    }
}
