Search in sources :

Example 16 with Init

use of cpw.mods.fml.common.Mod.Init in project MineFactoryReloaded by powercrystals.

the class Thaumcraft method load.

@Init
public static void load(FMLInitializationEvent e) {
    if (!Loader.isModLoaded("Thaumcraft")) {
        FMLLog.warning("Thaumcraft missing - MFR Thaumcraft Compat not loading");
        return;
    }
    try {
        Block tcSapling = (Block) Class.forName("thaumcraft.common.Config").getField("blockCustomPlant").get(null);
        Block tcLog = (Block) Class.forName("thaumcraft.common.Config").getField("blockMagicalLog").get(null);
        Block tcLeaves = (Block) Class.forName("thaumcraft.common.Config").getField("blockMagicalLeaves").get(null);
        Class<?> golem = Class.forName("thaumcraft.common.entities.golems.EntityGolemBase");
        MFRRegistry.registerHarvestable(new HarvestableStandard(tcLog.blockID, HarvestType.Tree));
        MFRRegistry.registerHarvestable(new HarvestableThaumcraftLeaves(tcLeaves.blockID, tcSapling.blockID));
        MFRRegistry.registerHarvestable(new HarvestableThaumcraftPlant(tcSapling.blockID));
        MFRRegistry.registerPlantable(new PlantableThaumcraftTree(tcSapling.blockID, tcSapling.blockID));
        MFRRegistry.registerAutoSpawnerBlacklistClass(golem);
        MFRRegistry.registerGrinderBlacklist(golem);
        // TODO: redo/remove wisp?
        MFRRegistry.registerGrindable(new GrindableWisp());
    } catch (Exception x) {
        x.printStackTrace();
    }
}
Also used : HarvestableStandard(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableStandard) Block(net.minecraft.block.Block) Init(cpw.mods.fml.common.Mod.Init)

Aggregations

Init (cpw.mods.fml.common.Mod.Init)16 ItemStack (net.minecraft.item.ItemStack)10 Block (net.minecraft.block.Block)8 Method (java.lang.reflect.Method)7 HarvestableStandard (powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableStandard)7 Item (net.minecraft.item.Item)6 HarvestableTreeLeaves (powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableTreeLeaves)6 PlantableStandard (powercrystals.minefactoryreloaded.farmables.plantables.PlantableStandard)6 PlantableCropPlant (powercrystals.minefactoryreloaded.farmables.plantables.PlantableCropPlant)5 PostInit (cpw.mods.fml.common.Mod.PostInit)2 FertilizerStandard (powercrystals.minefactoryreloaded.farmables.fertilizables.FertilizerStandard)2 FertilizableCropReflection (powercrystals.minefactoryreloaded.modhelpers.FertilizableCropReflection)2 PreInit (cpw.mods.fml.common.Mod.PreInit)1 ModContainer (cpw.mods.fml.common.ModContainer)1 Field (java.lang.reflect.Field)1 IBehaviorDispenseItem (net.minecraft.dispenser.IBehaviorDispenseItem)1 EntitySlime (net.minecraft.entity.monster.EntitySlime)1 EntityChicken (net.minecraft.entity.passive.EntityChicken)1 EntityOcelot (net.minecraft.entity.passive.EntityOcelot)1 EntityWolf (net.minecraft.entity.passive.EntityWolf)1