package com.zivilon.cinder_loe.blocks;

import com.zivilon.cinder_loe.CinderLoE;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import lotr.common.LOTRMod;
import net.minecraft.block.BlockCrops;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.EnumPlantType;

public class onionCrop
        extends BlockCrops {
    @SideOnly(value=Side.CLIENT)
    private IIcon[] onionIcons;

    @SideOnly(value=Side.CLIENT)
    public IIcon getIcon(int i, int j) {
        if (j < 7) {
            if (j == 6) {
                j = 5;
            }
            return this.onionIcons[j >> 1];
        }
        return this.onionIcons[3];
    }

    @SideOnly(value=Side.CLIENT)
    public void registerBlockIcons(IIconRegister iconregister) {
        this.onionIcons = new IIcon[4];
        for (int i = 0; i < this.onionIcons.length; ++i) {
            this.onionIcons[i] = iconregister.registerIcon(this.getTextureName() + "_" + i);
        }
    }


    public Item func_149866_i() {
        return CinderLoE.onion;
    }

    public Item func_149865_P() {
        return CinderLoE.onion;
    }

    public EnumPlantType getPlantType(IBlockAccess world, int i, int j, int k) {
        return EnumPlantType.Crop;
    }
}
