Search in sources :

Example 11 with Init

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

the class ForestryPre method init.

@Init
public static void init(FMLInitializationEvent e) {
    if (!Loader.isModLoaded("Forestry")) {
        return;
    }
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("milk", new LiquidStack(MineFactoryReloadedCore.milkLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(Item.bucketMilk), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("sludge", new LiquidStack(MineFactoryReloadedCore.sludgeLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.sludgeBucketItem), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("sewage", new LiquidStack(MineFactoryReloadedCore.sewageLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.sewageBucketItem), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("mobEssence", new LiquidStack(MineFactoryReloadedCore.essenceLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.mobEssenceBucketItem), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("biofuel", new LiquidStack(MineFactoryReloadedCore.biofuelLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.bioFuelBucketItem), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("meat", new LiquidStack(MineFactoryReloadedCore.meatLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.meatBucketItem), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("pinkslime", new LiquidStack(MineFactoryReloadedCore.pinkSlimeLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.pinkSlimeBucketItem), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("chocolatemilk", new LiquidStack(MineFactoryReloadedCore.chocolateMilkLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.chocolateMilkBucketItem), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("mushroomsoup", new LiquidStack(MineFactoryReloadedCore.mushroomSoupLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(MineFactoryReloadedCore.mushroomSoupBucketItem), new ItemStack(Item.bucketEmpty)));
    LiquidContainerRegistry.registerLiquid(new LiquidContainerData(LiquidDictionary.getOrCreateLiquid("mushroomsoup", new LiquidStack(MineFactoryReloadedCore.mushroomSoupLiquid, LiquidContainerRegistry.BUCKET_VOLUME)), new ItemStack(Item.bowlSoup), new ItemStack(Item.bowlEmpty)));
}
Also used : LiquidStack(net.minecraftforge.liquids.LiquidStack) LiquidContainerData(net.minecraftforge.liquids.LiquidContainerData) ItemStack(net.minecraft.item.ItemStack) Init(cpw.mods.fml.common.Mod.Init)

Example 12 with Init

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

the class IC2 method load.

@Init
public static void load(FMLInitializationEvent e) {
    if (!Loader.isModLoaded("IC2")) {
        FMLLog.warning("IC2 missing - MFR IC2 Compat not loading");
        return;
    }
    try {
        ItemStack crop = Items.getItem("crop");
        ItemStack rubber = Items.getItem("rubber");
        ItemStack rubberSapling = Items.getItem("rubberSapling");
        ItemStack rubberLeaves = Items.getItem("rubberLeaves");
        ItemStack rubberWood = Items.getItem("rubberWood");
        ItemStack stickyResin = Items.getItem("resin");
        ItemStack plantBall = Items.getItem("plantBall");
        if (rubberSapling != null) {
            MFRRegistry.registerPlantable(new PlantableStandard(rubberSapling.itemID, rubberSapling.itemID));
            MFRRegistry.registerFertilizable(new FertilizableIC2RubberTree(rubberSapling.itemID));
        }
        if (rubberLeaves != null) {
            MFRRegistry.registerHarvestable(new HarvestableTreeLeaves(rubberLeaves.itemID));
        }
        if (rubberWood != null) {
            MFRRegistry.registerHarvestable(new HarvestableIC2RubberWood(rubberWood.itemID, HarvestType.Tree, stickyResin.itemID));
            MFRRegistry.registerFruitLogBlockId(((ItemBlock) rubberWood.getItem()).getBlockID());
            MFRRegistry.registerFruit(new FruitIC2Resin(rubberWood, stickyResin));
        }
        ItemStack fertilizer = Items.getItem("fertilizer");
        if (fertilizer != null) {
            MFRRegistry.registerFertilizer(new FertilizerStandard(fertilizer.itemID, fertilizer.getItemDamage()));
        }
        MFRRegistry.registerHarvestable(new HarvestableIC2Crop(crop.itemID));
        GameRegistry.addShapedRecipe(plantBall, new Object[] { "LLL", "L L", "LLL", Character.valueOf('L'), new ItemStack(MineFactoryReloadedCore.rubberLeavesBlock) });
        Recipes.extractor.addRecipe(new ItemStack(MineFactoryReloadedCore.rubberSaplingBlock), rubber);
    } catch (Exception x) {
        x.printStackTrace();
    }
}
Also used : FertilizerStandard(powercrystals.minefactoryreloaded.farmables.fertilizables.FertilizerStandard) HarvestableTreeLeaves(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableTreeLeaves) ItemStack(net.minecraft.item.ItemStack) PlantableStandard(powercrystals.minefactoryreloaded.farmables.plantables.PlantableStandard) Init(cpw.mods.fml.common.Mod.Init)

Example 13 with Init

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

the class AppliedEnergistics method load.

@Init
public static void load(FMLInitializationEvent e) {
    if (!Loader.isModLoaded("AppliedEnergistics")) {
        FMLLog.warning("Applied Energistics missing - MFR Applied Energistics Compat not loading");
        return;
    }
    try {
        ItemStack quartzOre = (ItemStack) Class.forName("appeng.api.Blocks").getField("blkQuartzOre").get(null);
        MFRRegistry.registerLaserOre(60, quartzOre);
        MFRRegistry.addLaserPreferredOre(0, quartzOre);
    } catch (Exception x) {
        System.out.println("Last updated for " + lastUpdated);
        x.printStackTrace();
    }
}
Also used : ItemStack(net.minecraft.item.ItemStack) Init(cpw.mods.fml.common.Mod.Init)

Example 14 with Init

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

the class Atum method load.

@SuppressWarnings("rawtypes")
@Init
public static void load(FMLInitializationEvent e) {
    if (!Loader.isModLoaded("Atum")) {
        FMLLog.warning("Atum missing - MFR Atum Compat not loading");
        return;
    }
    try {
        Class AtumItems = Class.forName("rebelkeithy.mods.atum.AtumItems");
        Class AtumBlocks = Class.forName("rebelkeithy.mods.atum.AtumBlocks");
        String entityprefix = "rebelkeithy.mods.atum.entities.Entity";
        Class banditWarlord = Class.forName(entityprefix + "BanditWarlord");
        Class pharaoh = Class.forName(entityprefix + "Pharaoh");
        int atumLogId = ((Block) AtumBlocks.getField("log").get(null)).blockID;
        int atumLeavesId = ((Block) AtumBlocks.getField("leaves").get(null)).blockID;
        int atumSaplingId = ((Block) AtumBlocks.getField("palmSapling").get(null)).blockID;
        int flaxSeedsId = ((Item) AtumItems.getField("flaxSeeds").get(null)).itemID;
        int flaxId = ((Block) AtumBlocks.getField("flax").get(null)).blockID;
        int papyrusId = ((Block) AtumBlocks.getField("papyrus").get(null)).blockID;
        int shrubId = ((Block) AtumBlocks.getField("shrub").get(null)).blockID;
        int weedId = ((Block) AtumBlocks.getField("weed").get(null)).blockID;
        Method atumSaplingGrowTree = Class.forName("rebelkeithy.mods.atum.blocks.BlockPalmSapling").getMethod("growTree", World.class, int.class, int.class, int.class, Random.class);
        Method atumFlaxFertilize = Class.forName("rebelkeithy.mods.atum.blocks.BlockFlax").getMethod("fertilize", World.class, int.class, int.class, int.class);
        MFRRegistry.registerSafariNetBlacklist(banditWarlord);
        MFRRegistry.registerSafariNetBlacklist(pharaoh);
        MFRRegistry.registerGrinderBlacklist(banditWarlord);
        MFRRegistry.registerGrinderBlacklist(pharaoh);
        MFRRegistry.registerPlantable(new PlantableStandard(atumSaplingId, atumSaplingId));
        MFRRegistry.registerPlantable(new PlantableStandard(flaxSeedsId, flaxId));
        MFRRegistry.registerFertilizable(new FertilizableCropReflection(flaxId, atumFlaxFertilize, 5));
        MFRRegistry.registerFertilizable(new FertilizableSaplingReflection(atumSaplingId, atumSaplingGrowTree));
        MFRRegistry.registerHarvestable(new HarvestableStandard(atumLogId, HarvestType.Tree));
        MFRRegistry.registerHarvestable(new HarvestableTreeLeaves(atumLeavesId));
        MFRRegistry.registerHarvestable(new HarvestableStandard(flaxId, HarvestType.Normal));
        MFRRegistry.registerHarvestable(new HarvestableStandard(papyrusId, HarvestType.LeaveBottom));
        MFRRegistry.registerHarvestable(new HarvestableStandard(shrubId, HarvestType.Normal));
        MFRRegistry.registerHarvestable(new HarvestableStandard(weedId, HarvestType.Normal));
    } catch (Exception x) {
        System.out.println("Last updated for " + lastUpdated);
        x.printStackTrace();
    }
}
Also used : Item(net.minecraft.item.Item) FertilizableSaplingReflection(powercrystals.minefactoryreloaded.modhelpers.FertilizableSaplingReflection) HarvestableStandard(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableStandard) FertilizableCropReflection(powercrystals.minefactoryreloaded.modhelpers.FertilizableCropReflection) Block(net.minecraft.block.Block) Method(java.lang.reflect.Method) HarvestableTreeLeaves(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableTreeLeaves) PlantableStandard(powercrystals.minefactoryreloaded.farmables.plantables.PlantableStandard) Init(cpw.mods.fml.common.Mod.Init)

Example 15 with Init

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

the class ExtraBiomes method load.

@Init
public static void load(FMLInitializationEvent ev) {
    if (!Loader.isModLoaded("ExtrabiomesXL")) {
        FMLLog.warning("ExtraBiomesXL missing - MFR ExtraBiomesXL Compat not loading");
        return;
    }
    _harvestRegistries = new HashMap<String, HarvestType>();
    _harvestRegistries.put("CATTAIL", HarvestType.Normal);
    _harvestRegistries.put("FLOWER", HarvestType.Normal);
    _harvestRegistries.put("GRASS", HarvestType.Normal);
    _harvestRegistries.put("LEAFPILE", HarvestType.Normal);
    _harvestRegistries.put("CUSTOMLOG", HarvestType.Tree);
    _harvestRegistries.put("QUARTERLOG0", HarvestType.Tree);
    _harvestRegistries.put("QUARTERLOG1", HarvestType.Tree);
    _harvestRegistries.put("QUARTERLOG2", HarvestType.Tree);
    _harvestRegistries.put("QUARTERLOG3", HarvestType.Tree);
    try {
        Class<?> xbbs = Class.forName("extrabiomes.lib.BlockSettings");
        for (String s : new String[] { "AUTUMNLEAVES", "GREENLEAVES" }) {
            Object o = xbbs.getField(s).get(null);
            Integer blockID = (Integer) xbbs.getMethod("getID").invoke(o);
            MFRRegistry.registerHarvestable(new HarvestableTreeLeaves(blockID));
        }
        for (Entry<String, HarvestType> e : _harvestRegistries.entrySet()) {
            Object o = xbbs.getField(e.getKey()).get(null);
            Integer blockID = (Integer) xbbs.getMethod("getID").invoke(o);
            MFRRegistry.registerHarvestable(new HarvestableStandard(blockID, e.getValue()));
        }
        for (String s : new String[] { "SAPLING", "CATTAIL" }) {
            Object o = xbbs.getField(s).get(null);
            Integer blockID = (Integer) xbbs.getMethod("getID").invoke(o);
            MFRRegistry.registerPlantable(new PlantableStandard(blockID, blockID));
        }
        Class<?> xbs = Class.forName("extrabiomes.blocks.BlockCustomSapling");
        Method fert = xbs.getMethod("growTree", World.class, int.class, int.class, int.class, Random.class);
        Object o = xbbs.getField("SAPLING").get(null);
        int saplingBlockID = (Integer) xbbs.getMethod("getID").invoke(o);
        MFRRegistry.registerFertilizable(new FertilizableExtraBiomesTree(saplingBlockID, fert));
        MFRRegistry.registerSludgeDrop(15, new ItemStack((Integer) xbbs.getMethod("getID").invoke(xbbs.getField("QUICKSAND").get(null)), 1, 0));
        MFRRegistry.registerSludgeDrop(15, new ItemStack((Integer) xbbs.getMethod("getID").invoke(xbbs.getField("CRACKEDSAND").get(null)), 1, 0));
        MFRRegistry.registerRubberTreeBiome("Autumn Woods");
        MFRRegistry.registerRubberTreeBiome("Birch Forest");
        MFRRegistry.registerRubberTreeBiome("Extreme Jungle");
        MFRRegistry.registerRubberTreeBiome("Forested Hills");
        MFRRegistry.registerRubberTreeBiome("Forested Island");
        MFRRegistry.registerRubberTreeBiome("Green Hills");
        MFRRegistry.registerRubberTreeBiome("Green Swamplands");
        MFRRegistry.registerRubberTreeBiome("Mini Jungle");
        MFRRegistry.registerRubberTreeBiome("Mountain Taiga");
        MFRRegistry.registerRubberTreeBiome("Pine Forest");
        MFRRegistry.registerRubberTreeBiome("Rainforest");
        MFRRegistry.registerRubberTreeBiome("Redwood Forest");
        MFRRegistry.registerRubberTreeBiome("Lush Redwoods");
        MFRRegistry.registerRubberTreeBiome("Snow Forest");
        MFRRegistry.registerRubberTreeBiome("Snowy Rainforest");
        MFRRegistry.registerRubberTreeBiome("Temperate Rainforest");
        MFRRegistry.registerRubberTreeBiome("Woodlands");
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : HarvestType(powercrystals.minefactoryreloaded.api.HarvestType) HarvestableTreeLeaves(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableTreeLeaves) Method(java.lang.reflect.Method) HarvestableStandard(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableStandard) ItemStack(net.minecraft.item.ItemStack) PlantableStandard(powercrystals.minefactoryreloaded.farmables.plantables.PlantableStandard) 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