package com.InfinityRaider.AgriCraft.compatibility.witchery;

import com.InfinityRaider.AgriCraft.apiimpl.v1.cropplant.CropPlantGeneric;
import com.emoniph.witchery.Witchery;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.item.ItemSeeds;

public class CropPlantWitchery extends CropPlantGeneric {
    private final int tier;

    public CropPlantWitchery(ItemSeeds seed) {
        this(seed, 3);
    }

    public CropPlantWitchery(ItemSeeds seed, int tier) {
        super(seed);
        this.tier = tier;
    }

    @Override
    public int tier() {
        return tier;
    }

    @Override
    public int transformMeta(int growthStage) {
        return growthStage==7?4:(int) (((float) growthStage)/2.0F);
    }

    @Override
    @SideOnly(Side.CLIENT)
    public boolean renderAsFlower() {
        return getSeed().getItem()!= Witchery.Items.SEEDS_BELLADONNA;
    }

    @Override
    @SideOnly(Side.CLIENT)
    public String getInformation() {
        String name = getSeed().getUnlocalizedName();
        name = name.substring(name.indexOf(':')+1);
        int index = name.indexOf("seeds");
        name = index<0?name:name.substring(index+"seeds".length());
        return "agricraft_journal.wi_"+Character.toUpperCase(name.charAt(0))+name.substring(1);
    }
}

@@ -134,46 +134,8 @@
 ic;%0A
-import com.emoniph.witchery.Witchery;%0A
 impo
@@ -167,16 +167,16 @@
 r.Side;%0A
+
 import c
@@ -208,16 +208,48 @@
 deOnly;%0A
+import net.minecraft.item.Item;%0A
 import n
@@ -278,16 +278,16 @@
 Seeds;%0A%0A
-
 public c
@@ -336,16 +336,130 @@
 neric %7B%0A
+    protected static final Item BELLADONNA_SEED = (Item) Item.itemRegistry.getObject(%22witchery:seedsbelladonna%22);%0A
     priv
@@ -990,29 +990,8 @@
 )!= 
-Witchery.Items.SEEDS_
 BELL
@@ -996,16 +996,21 @@
 LLADONNA
+_SEED
 ;%0A    %7D%0A

Replace direct referencing of Witchery classes with reflection (#371)