Search in sources :

Example 6 with Init

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

the class RP2 method load.

@Init
public static void load(FMLInitializationEvent e) {
    if (!Loader.isModLoaded("RedPowerWorld")) {
        FMLLog.warning("RedPowerWorld missing - MFR RedPower2 Compat not loading");
        return;
    }
    try {
        Class<?> modClass = Class.forName("com.eloraam.redpower.RedPowerWorld");
        int blockIdLeaves = ((Block) modClass.getField("blockLeaves").get(null)).blockID;
        int blockIdLogs = ((Block) modClass.getField("blockLogs").get(null)).blockID;
        int blockIdPlants = ((Block) modClass.getField("blockPlants").get(null)).blockID;
        int blockIdCrops = ((Block) modClass.getField("blockCrops").get(null)).blockID;
        int itemCropSeedId = ((Item) modClass.getField("itemSeeds").get(null)).itemID;
        Method fertilizeMethod = Class.forName("com.eloraam.redpower.world.BlockCustomFlower").getMethod("growTree", World.class, int.class, int.class, int.class);
        MFRRegistry.registerHarvestable(new HarvestableTreeLeaves(blockIdLeaves));
        MFRRegistry.registerHarvestable(new HarvestableStandard(blockIdLogs, HarvestType.Tree));
        MFRRegistry.registerHarvestable(new HarvestableRedPowerPlant(blockIdPlants));
        MFRRegistry.registerHarvestable(new HarvestableRedPowerFlax(blockIdCrops));
        MFRRegistry.registerPlantable(new PlantableStandard(blockIdPlants, blockIdPlants));
        MFRRegistry.registerPlantable(new PlantableCropPlant(itemCropSeedId, blockIdCrops));
        MFRRegistry.registerFertilizable(new FertilizableRedPowerFlax(blockIdCrops));
        MFRRegistry.registerFertilizable(new FertilizableRedPowerRubberTree(blockIdPlants, fertilizeMethod));
    } catch (Exception x) {
        x.printStackTrace();
    }
}
Also used : Method(java.lang.reflect.Method) HarvestableTreeLeaves(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableTreeLeaves) Item(net.minecraft.item.Item) HarvestableStandard(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableStandard) PlantableCropPlant(powercrystals.minefactoryreloaded.farmables.plantables.PlantableCropPlant) Block(net.minecraft.block.Block) PlantableStandard(powercrystals.minefactoryreloaded.farmables.plantables.PlantableStandard) Init(cpw.mods.fml.common.Mod.Init)

Example 7 with Init

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

the class MagicalCrops method load.

@Init
public static void load(FMLInitializationEvent e) {
    if (!Loader.isModLoaded("Magical-Crops")) {
        FMLLog.warning("Magical Crops missing - MFR Compat: Magical Crops not loading");
        return;
    }
    try {
        Class<?> mod = Class.forName("magicCrop.mod_mCrops");
        // the various plants are separated by type to make future changes easier (mostly considering magicFertilizer behavior)
        String[] crops = { "Sberry", "Tomato", "Sweetcorn", "Cucum", "Melon", "Bberry", "Rberry", "Grape", "Chil" };
        String[] namedAsMagicalCropButExtendsBlockCrops = { "Nether" };
        String[] magicalCrops = { "Coal", "Dye", "Iron", "Redstone", "Glowstone", "Gold", "Diamond", "Lapis", "Blaze", "Emerald", "Ender", "Gunpowder", "XP", "Copper", "Tin", "Obsidian" };
        String[] soulCrops = { "Cow", "Pigmen", "Skele", "Spider" };
        int seedId;
        int blockId;
        Method fertilize;
        for (String crop : crops) {
            seedId = ((Item) mod.getField("seed" + crop).get(null)).itemID;
            blockId = ((Block) mod.getField("crop" + crop).get(null)).blockID;
            fertilize = Class.forName("magicCrop.crop" + crop).getMethod("func_72272_c_", World.class, int.class, int.class, int.class);
            MFRRegistry.registerPlantable(new PlantableCropPlant(seedId, blockId));
            MFRRegistry.registerHarvestable(new HarvestableCropPlant(blockId, 7));
            MFRRegistry.registerFertilizable(new FertilizableCropReflection(blockId, fertilize, 7));
        }
        for (String crop : namedAsMagicalCropButExtendsBlockCrops) {
            seedId = ((Item) mod.getField("mSeeds" + crop).get(null)).itemID;
            blockId = ((Block) mod.getField("mCrop" + crop).get(null)).blockID;
            fertilize = Class.forName("magicCrop.mCrop" + crop).getMethod("func_72272_c_", World.class, int.class, int.class, int.class);
            MFRRegistry.registerPlantable(new PlantableCropPlant(seedId, blockId));
            MFRRegistry.registerHarvestable(new HarvestableCropPlant(blockId, 7));
            MFRRegistry.registerFertilizable(new FertilizableCropReflection(blockId, fertilize, 7));
        }
        for (String magicalCrop : magicalCrops) {
            seedId = ((Item) mod.getField("mSeeds" + magicalCrop).get(null)).itemID;
            blockId = ((Block) mod.getField("mCrop" + magicalCrop).get(null)).blockID;
            fertilize = Class.forName("magicCrop.mCrop" + magicalCrop).getMethod("fertilize", World.class, int.class, int.class, int.class);
            MFRRegistry.registerPlantable(new PlantableCropPlant(seedId, blockId));
            MFRRegistry.registerHarvestable(new HarvestableCropPlant(blockId, 7));
            MFRRegistry.registerFertilizable(new FertilizableMagicalCropReflection(blockId, fertilize, 7));
        }
        for (String soulCrop : soulCrops) {
            seedId = ((Item) mod.getField("soulSeed" + soulCrop).get(null)).itemID;
            blockId = ((Block) mod.getField("soulCrop" + soulCrop).get(null)).blockID;
            fertilize = Class.forName("magicCrop.soulCrop" + soulCrop).getMethod("fertilize", World.class, int.class, int.class, int.class);
            MFRRegistry.registerPlantable(new PlantableCropPlant(seedId, blockId));
            MFRRegistry.registerHarvestable(new HarvestableCropPlant(blockId, 7));
            MFRRegistry.registerFertilizable(new FertilizableMagicalCropReflection(blockId, fertilize, 7));
        }
        Item magicalFertilizer = (Item) mod.getField("magicFertilizer").get(null);
        if (magicalFertilizer != null) {
            MFRRegistry.registerFertilizer(new FertilizerStandard(magicalFertilizer.itemID, 0, FertilizerType.GrowMagicalCrop));
        }
    } catch (Exception x) {
        FMLLog.warning("Something went wrong in MFR Compat: Magical Crops. Probably Emy's fault.");
        System.out.println("Last updated for " + lastUpdated);
        x.printStackTrace();
    }
}
Also used : Method(java.lang.reflect.Method) World(net.minecraft.world.World) Item(net.minecraft.item.Item) HarvestableCropPlant(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableCropPlant) FertilizerStandard(powercrystals.minefactoryreloaded.farmables.fertilizables.FertilizerStandard) FertilizableCropReflection(powercrystals.minefactoryreloaded.modhelpers.FertilizableCropReflection) PlantableCropPlant(powercrystals.minefactoryreloaded.farmables.plantables.PlantableCropPlant) Init(cpw.mods.fml.common.Mod.Init)

Example 8 with Init

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

the class Vanilla method load.

@Init
public void load(FMLInitializationEvent event) {
    MFRRegistry.registerPlantable(new PlantableStandard(Block.sapling.blockID, Block.sapling.blockID));
    MFRRegistry.registerPlantable(new PlantableStandard(Item.pumpkinSeeds.itemID, Block.pumpkinStem.blockID));
    MFRRegistry.registerPlantable(new PlantableStandard(Item.melonSeeds.itemID, Block.melonStem.blockID));
    MFRRegistry.registerPlantable(new PlantableStandard(Block.mushroomBrown.blockID, Block.mushroomBrown.blockID));
    MFRRegistry.registerPlantable(new PlantableStandard(Block.mushroomRed.blockID, Block.mushroomRed.blockID));
    MFRRegistry.registerPlantable(new PlantableCropPlant(Item.seeds.itemID, Block.crops.blockID));
    MFRRegistry.registerPlantable(new PlantableCropPlant(Item.carrot.itemID, Block.carrot.blockID));
    MFRRegistry.registerPlantable(new PlantableCropPlant(Item.potato.itemID, Block.potato.blockID));
    MFRRegistry.registerPlantable(new PlantableNetherWart());
    MFRRegistry.registerPlantable(new PlantableCocoa());
    MFRRegistry.registerPlantable(new PlantableStandard(MineFactoryReloadedCore.rubberSaplingBlock.blockID, MineFactoryReloadedCore.rubberSaplingBlock.blockID));
    MFRRegistry.registerHarvestable(new HarvestableWood());
    MFRRegistry.registerHarvestable(new HarvestableTreeLeaves(Block.leaves.blockID));
    MFRRegistry.registerHarvestable(new HarvestableStandard(Block.reed.blockID, HarvestType.LeaveBottom));
    MFRRegistry.registerHarvestable(new HarvestableStandard(Block.cactus.blockID, HarvestType.LeaveBottom));
    MFRRegistry.registerHarvestable(new HarvestableStandard(Block.plantRed.blockID, HarvestType.Normal));
    MFRRegistry.registerHarvestable(new HarvestableStandard(Block.plantYellow.blockID, HarvestType.Normal));
    MFRRegistry.registerHarvestable(new HarvestableShrub(Block.tallGrass.blockID));
    MFRRegistry.registerHarvestable(new HarvestableShrub(Block.deadBush.blockID));
    MFRRegistry.registerHarvestable(new HarvestableStandard(Block.mushroomCapBrown.blockID, HarvestType.Tree));
    MFRRegistry.registerHarvestable(new HarvestableStandard(Block.mushroomCapRed.blockID, HarvestType.Tree));
    MFRRegistry.registerHarvestable(new HarvestableMushroom(Block.mushroomBrown.blockID));
    MFRRegistry.registerHarvestable(new HarvestableMushroom(Block.mushroomRed.blockID));
    MFRRegistry.registerHarvestable(new HarvestableStemPlant(Block.pumpkin.blockID, HarvestType.Normal));
    MFRRegistry.registerHarvestable(new HarvestableStemPlant(Block.melon.blockID, HarvestType.Normal));
    MFRRegistry.registerHarvestable(new HarvestableCropPlant(Block.crops.blockID, 7));
    MFRRegistry.registerHarvestable(new HarvestableCropPlant(Block.carrot.blockID, 7));
    MFRRegistry.registerHarvestable(new HarvestableCropPlant(Block.potato.blockID, 7));
    MFRRegistry.registerHarvestable(new HarvestableVine());
    MFRRegistry.registerHarvestable(new HarvestableNetherWart());
    MFRRegistry.registerHarvestable(new HarvestableCocoa());
    MFRRegistry.registerHarvestable(new HarvestableStandard(MineFactoryReloadedCore.rubberWoodBlock.blockID, HarvestType.Tree));
    MFRRegistry.registerHarvestable(new HarvestableTreeLeaves(MineFactoryReloadedCore.rubberLeavesBlock.blockID));
    MFRRegistry.registerFertilizable(new FertilizableSapling(Block.sapling.blockID));
    MFRRegistry.registerFertilizable(new FertilizableCropPlant(Block.crops.blockID, 7));
    MFRRegistry.registerFertilizable(new FertilizableCropPlant(Block.carrot.blockID, 7));
    MFRRegistry.registerFertilizable(new FertilizableCropPlant(Block.potato.blockID, 7));
    MFRRegistry.registerFertilizable(new FertilizableGiantMushroom(Block.mushroomBrown.blockID));
    MFRRegistry.registerFertilizable(new FertilizableGiantMushroom(Block.mushroomRed.blockID));
    MFRRegistry.registerFertilizable(new FertilizableStemPlants(Block.pumpkinStem.blockID));
    MFRRegistry.registerFertilizable(new FertilizableStemPlants(Block.melonStem.blockID));
    MFRRegistry.registerFertilizable(new FertilizableNetherWart());
    MFRRegistry.registerFertilizable(new FertilizableCocoa());
    MFRRegistry.registerFertilizable(new FertilizableGrass());
    MFRRegistry.registerFertilizable(new FertilizableRubberSapling());
    MFRRegistry.registerFertilizer(new FertilizerStandard(MineFactoryReloadedCore.fertilizerItem.itemID, 0));
    if (MFRConfig.enableBonemealFertilizing.getBoolean(false)) {
        MFRRegistry.registerFertilizer(new FertilizerStandard(Item.dyePowder.itemID, 15));
    } else {
        MFRRegistry.registerFertilizer(new FertilizerStandard(Item.dyePowder.itemID, 15, FertilizerType.Grass));
    }
    MFRRegistry.registerRanchable(new RanchableCow());
    MFRRegistry.registerRanchable(new RanchableMooshroom());
    MFRRegistry.registerRanchable(new RanchableSheep());
    MFRRegistry.registerRanchable(new RanchableSquid());
    MFRRegistry.registerRanchable(new RanchableChicken());
    MFRRegistry.registerGrinderBlacklist(EntityPlayer.class);
    MFRRegistry.registerGrinderBlacklist(EntityDragon.class);
    MFRRegistry.registerGrinderBlacklist(EntityWither.class);
    MFRRegistry.registerGrinderBlacklist(EntityVillager.class);
    MFRRegistry.registerGrindable(new GrindableStandard(EntityChicken.class, new MobDrop[] { new MobDrop(30, null), new MobDrop(10, new ItemStack(Item.egg)) }, false));
    MFRRegistry.registerGrindable(new GrindableStandard(EntityOcelot.class, new MobDrop[] { new MobDrop(10, new ItemStack(Item.fishRaw)), new MobDrop(10, new ItemStack(Item.silk)) }));
    MFRRegistry.registerGrindable(new GrindableStandard(EntityWolf.class, new ItemStack(Item.bone)));
    MFRRegistry.registerGrindable(new GrindableZombiePigman());
    MFRRegistry.registerGrindable(new GrindableSlime(EntitySlime.class, new ItemStack(Item.slimeBall), 1));
    MFRRegistry.registerGrindable(new GrindableSlime(EntityPinkSlime.class, new ItemStack(MineFactoryReloadedCore.pinkSlimeballItem), 1));
    MFRRegistry.registerSludgeDrop(50, new ItemStack(Block.sand));
    MFRRegistry.registerSludgeDrop(40, new ItemStack(Block.dirt));
    MFRRegistry.registerSludgeDrop(30, new ItemStack(Item.clay, 4));
    MFRRegistry.registerSludgeDrop(3, new ItemStack(Block.mycelium));
    MFRRegistry.registerSludgeDrop(5, new ItemStack(Block.slowSand));
    MFRRegistry.registerBreederFood(EntityChicken.class, new ItemStack(Item.seeds));
    MFRRegistry.registerBreederFood(EntityChicken.class, new ItemStack(Item.melonSeeds));
    MFRRegistry.registerBreederFood(EntityChicken.class, new ItemStack(Item.pumpkinSeeds));
    MFRRegistry.registerBreederFood(EntityChicken.class, new ItemStack(Item.netherStalkSeeds));
    MFRRegistry.registerBreederFood(EntityWolf.class, new ItemStack(Item.porkCooked));
    MFRRegistry.registerBreederFood(EntityOcelot.class, new ItemStack(Item.fishRaw));
    MFRRegistry.registerBreederFood(EntityPig.class, new ItemStack(Item.carrot));
    MFRRegistry.registerSafariNetHandler(new EntityLivingHandler());
    MFRRegistry.registerSafariNetHandler(new EntityAgeableHandler());
    MFRRegistry.registerSafariNetHandler(new SheepHandler());
    MFRRegistry.registerSafariNetHandler(new SlimeHandler());
    MFRRegistry.registerMobEggHandler(new VanillaEggHandler());
    MFRRegistry.registerRubberTreeBiome("Swampland");
    MFRRegistry.registerRubberTreeBiome("Forest");
    MFRRegistry.registerRubberTreeBiome("Taiga");
    MFRRegistry.registerRubberTreeBiome("TaigaHills");
    MFRRegistry.registerRubberTreeBiome("Jungle");
    MFRRegistry.registerRubberTreeBiome("JungleHills");
    MFRRegistry.registerSafariNetBlacklist(EntityPlayer.class);
    MFRRegistry.registerSafariNetBlacklist(EntityDragon.class);
    MFRRegistry.registerSafariNetBlacklist(EntityWither.class);
    MFRRegistry.registerRandomMobProvider(new VanillaMobProvider());
    MFRRegistry.registerLiquidDrinkHandler(Block.waterStill.blockID, new DrinkHandlerWater());
    MFRRegistry.registerLiquidDrinkHandler(Block.waterMoving.blockID, new DrinkHandlerWater());
    MFRRegistry.registerLiquidDrinkHandler(Block.lavaStill.blockID, new DrinkHandlerLava());
    MFRRegistry.registerLiquidDrinkHandler(Block.lavaMoving.blockID, new DrinkHandlerLava());
    MFRRegistry.registerLiquidDrinkHandler(MineFactoryReloadedCore.milkLiquid.blockID, new DrinkHandlerMilk());
    MFRRegistry.registerLiquidDrinkHandler(MineFactoryReloadedCore.biofuelLiquid.blockID, new DrinkHandlerBiofuel());
    MFRRegistry.registerLiquidDrinkHandler(MineFactoryReloadedCore.sewageLiquid.blockID, new DrinkHandlerSewage());
    MFRRegistry.registerLiquidDrinkHandler(MineFactoryReloadedCore.sludgeLiquid.blockID, new DrinkHandlerSludge());
    MFRRegistry.registerLiquidDrinkHandler(MineFactoryReloadedCore.essenceLiquid.blockID, new DrinkHandlerMobEssence());
    MFRRegistry.registerLiquidDrinkHandler(MineFactoryReloadedCore.meatLiquid.blockID, new DrinkHandlerMeat());
    MFRRegistry.registerLiquidDrinkHandler(MineFactoryReloadedCore.pinkSlimeLiquid.blockID, new DrinkHandlerPinkSlime());
    MFRRegistry.registerLiquidDrinkHandler(MineFactoryReloadedCore.chocolateMilkLiquid.blockID, new DrinkHandlerChocolateMilk());
    MFRRegistry.registerLiquidDrinkHandler(MineFactoryReloadedCore.mushroomSoupLiquid.blockID, new DrinkHandlerMushroomSoup());
    MFRRegistry.registerRedNetLogicCircuit(new AdderAnalog());
    MFRRegistry.registerRedNetLogicCircuit(new AdderDigitalFull());
    MFRRegistry.registerRedNetLogicCircuit(new AdderDigitalHalf());
    MFRRegistry.registerRedNetLogicCircuit(new And2());
    MFRRegistry.registerRedNetLogicCircuit(new And3());
    MFRRegistry.registerRedNetLogicCircuit(new And4());
    MFRRegistry.registerRedNetLogicCircuit(new Counter());
    MFRRegistry.registerRedNetLogicCircuit(new DecomposeIntToDecimal());
    MFRRegistry.registerRedNetLogicCircuit(new Delay());
    MFRRegistry.registerRedNetLogicCircuit(new DeMux16Analog());
    MFRRegistry.registerRedNetLogicCircuit(new DeMux4());
    MFRRegistry.registerRedNetLogicCircuit(new Equal());
    MFRRegistry.registerRedNetLogicCircuit(new Fanout());
    MFRRegistry.registerRedNetLogicCircuit(new FlipFlopJK());
    MFRRegistry.registerRedNetLogicCircuit(new FlipFlopT());
    MFRRegistry.registerRedNetLogicCircuit(new Greater());
    MFRRegistry.registerRedNetLogicCircuit(new GreaterOrEqual());
    MFRRegistry.registerRedNetLogicCircuit(new Inverter());
    MFRRegistry.registerRedNetLogicCircuit(new LatchDGated());
    MFRRegistry.registerRedNetLogicCircuit(new LatchSR());
    MFRRegistry.registerRedNetLogicCircuit(new LatchSRGated());
    MFRRegistry.registerRedNetLogicCircuit(new Less());
    MFRRegistry.registerRedNetLogicCircuit(new LessOrEqual());
    MFRRegistry.registerRedNetLogicCircuit(new Max2());
    MFRRegistry.registerRedNetLogicCircuit(new Max3());
    MFRRegistry.registerRedNetLogicCircuit(new Max4());
    MFRRegistry.registerRedNetLogicCircuit(new Min2());
    MFRRegistry.registerRedNetLogicCircuit(new Min3());
    MFRRegistry.registerRedNetLogicCircuit(new Min4());
    MFRRegistry.registerRedNetLogicCircuit(new Multipulse());
    MFRRegistry.registerRedNetLogicCircuit(new Mux4());
    MFRRegistry.registerRedNetLogicCircuit(new Nand2());
    MFRRegistry.registerRedNetLogicCircuit(new Nand3());
    MFRRegistry.registerRedNetLogicCircuit(new Nand4());
    MFRRegistry.registerRedNetLogicCircuit(new Negator());
    MFRRegistry.registerRedNetLogicCircuit(new Noop());
    MFRRegistry.registerRedNetLogicCircuit(new Nor2());
    MFRRegistry.registerRedNetLogicCircuit(new Nor3());
    MFRRegistry.registerRedNetLogicCircuit(new Nor4());
    MFRRegistry.registerRedNetLogicCircuit(new NotEqual());
    MFRRegistry.registerRedNetLogicCircuit(new OneShot());
    MFRRegistry.registerRedNetLogicCircuit(new Or2());
    MFRRegistry.registerRedNetLogicCircuit(new Or3());
    MFRRegistry.registerRedNetLogicCircuit(new Or4());
    MFRRegistry.registerRedNetLogicCircuit(new Passthrough());
    MFRRegistry.registerRedNetLogicCircuit(new PassthroughGated());
    MFRRegistry.registerRedNetLogicCircuit(new PassthroughRoundRobin());
    MFRRegistry.registerRedNetLogicCircuit(new PulseLengthener());
    MFRRegistry.registerRedNetLogicCircuit(new RandomizerAnalog());
    MFRRegistry.registerRedNetLogicCircuit(new RandomizerDigital());
    MFRRegistry.registerRedNetLogicCircuit(new SevenSegmentEncoder());
    MFRRegistry.registerRedNetLogicCircuit(new SawtoothFalling());
    MFRRegistry.registerRedNetLogicCircuit(new SawtoothRising());
    MFRRegistry.registerRedNetLogicCircuit(new Scaler());
    MFRRegistry.registerRedNetLogicCircuit(new SchmittTrigger());
    MFRRegistry.registerRedNetLogicCircuit(new Sine());
    MFRRegistry.registerRedNetLogicCircuit(new Square());
    MFRRegistry.registerRedNetLogicCircuit(new Subtractor());
    MFRRegistry.registerRedNetLogicCircuit(new Triangle());
    MFRRegistry.registerRedNetLogicCircuit(new Xnor2());
    MFRRegistry.registerRedNetLogicCircuit(new Xnor3());
    MFRRegistry.registerRedNetLogicCircuit(new Xnor4());
    MFRRegistry.registerRedNetLogicCircuit(new Xor2());
    MFRRegistry.registerRedNetLogicCircuit(new Xor3());
    MFRRegistry.registerRedNetLogicCircuit(new Xor4());
    MFRRegistry.registerLaserOre(175, new ItemStack(Block.oreCoal));
    MFRRegistry.registerLaserOre(50, new ItemStack(Block.oreDiamond));
    MFRRegistry.registerLaserOre(50, new ItemStack(Block.oreEmerald));
    MFRRegistry.registerLaserOre(70, new ItemStack(Block.oreGold));
    MFRRegistry.registerLaserOre(150, new ItemStack(Block.oreIron));
    MFRRegistry.registerLaserOre(80, new ItemStack(Block.oreLapis));
    MFRRegistry.registerLaserOre(100, new ItemStack(Block.oreRedstone));
    MFRRegistry.registerLaserOre(50, new ItemStack(Block.oreNetherQuartz));
    MFRRegistry.registerLaserOre(80, new ItemStack(Block.glowStone));
    MFRRegistry.registerFruitLogBlockId(Block.wood.blockID);
    MFRRegistry.registerFruit(new FruitCocoa());
    MFRRegistry.registerAutoSpawnerBlacklist("VillagerGolem");
    MFRRegistry.addLaserPreferredOre(15, new ItemStack(Block.oreCoal));
    MFRRegistry.addLaserPreferredOre(3, new ItemStack(Block.oreDiamond));
    MFRRegistry.addLaserPreferredOre(5, new ItemStack(Block.oreEmerald));
    MFRRegistry.addLaserPreferredOre(4, new ItemStack(Block.oreGold));
    MFRRegistry.addLaserPreferredOre(12, new ItemStack(Block.oreIron));
    MFRRegistry.addLaserPreferredOre(11, new ItemStack(Block.oreLapis));
    MFRRegistry.addLaserPreferredOre(14, new ItemStack(Block.oreRedstone));
    MFRRegistry.addLaserPreferredOre(0, new ItemStack(Block.oreNetherQuartz));
    MFRRegistry.registerNeedleAmmoType(MineFactoryReloadedCore.needlegunAmmoStandardItem.itemID, (INeedleAmmo) MineFactoryReloadedCore.needlegunAmmoStandardItem);
    MFRRegistry.registerNeedleAmmoType(MineFactoryReloadedCore.needlegunAmmoLavaItem.itemID, (INeedleAmmo) MineFactoryReloadedCore.needlegunAmmoLavaItem);
    MFRRegistry.registerNeedleAmmoType(MineFactoryReloadedCore.needlegunAmmoSludgeItem.itemID, (INeedleAmmo) MineFactoryReloadedCore.needlegunAmmoSludgeItem);
    MFRRegistry.registerNeedleAmmoType(MineFactoryReloadedCore.needlegunAmmoSewageItem.itemID, (INeedleAmmo) MineFactoryReloadedCore.needlegunAmmoSewageItem);
    MFRRegistry.registerNeedleAmmoType(MineFactoryReloadedCore.needlegunAmmoFireItem.itemID, (INeedleAmmo) MineFactoryReloadedCore.needlegunAmmoFireItem);
    MFRRegistry.registerNeedleAmmoType(MineFactoryReloadedCore.needlegunAmmoAnvilItem.itemID, (INeedleAmmo) MineFactoryReloadedCore.needlegunAmmoAnvilItem);
}
Also used : Passthrough(powercrystals.minefactoryreloaded.circuits.Passthrough) HarvestableNetherWart(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableNetherWart) HarvestableMushroom(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableMushroom) SawtoothRising(powercrystals.minefactoryreloaded.circuits.wave.SawtoothRising) Triangle(powercrystals.minefactoryreloaded.circuits.wave.Triangle) RanchableCow(powercrystals.minefactoryreloaded.farmables.ranchables.RanchableCow) SheepHandler(powercrystals.minefactoryreloaded.farmables.safarinethandlers.SheepHandler) HarvestableCropPlant(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableCropPlant) GreaterOrEqual(powercrystals.minefactoryreloaded.circuits.logicboolean.GreaterOrEqual) Equal(powercrystals.minefactoryreloaded.circuits.logicboolean.Equal) LessOrEqual(powercrystals.minefactoryreloaded.circuits.logicboolean.LessOrEqual) NotEqual(powercrystals.minefactoryreloaded.circuits.logicboolean.NotEqual) GrindableSlime(powercrystals.minefactoryreloaded.farmables.grindables.GrindableSlime) OneShot(powercrystals.minefactoryreloaded.circuits.timing.OneShot) DeMux4(powercrystals.minefactoryreloaded.circuits.digital.DeMux4) Multipulse(powercrystals.minefactoryreloaded.circuits.timing.Multipulse) PulseLengthener(powercrystals.minefactoryreloaded.circuits.timing.PulseLengthener) DrinkHandlerMobEssence(powercrystals.minefactoryreloaded.farmables.drinkhandlers.DrinkHandlerMobEssence) NotEqual(powercrystals.minefactoryreloaded.circuits.logicboolean.NotEqual) EntityPinkSlime(powercrystals.minefactoryreloaded.entity.EntityPinkSlime) AdderDigitalFull(powercrystals.minefactoryreloaded.circuits.digital.AdderDigitalFull) HarvestableTreeLeaves(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableTreeLeaves) FertilizableRubberSapling(powercrystals.minefactoryreloaded.farmables.fertilizables.FertilizableRubberSapling) Square(powercrystals.minefactoryreloaded.circuits.wave.Square) SlimeHandler(powercrystals.minefactoryreloaded.farmables.safarinethandlers.SlimeHandler) DecomposeIntToDecimal(powercrystals.minefactoryreloaded.circuits.analog.DecomposeIntToDecimal) DrinkHandlerChocolateMilk(powercrystals.minefactoryreloaded.farmables.drinkhandlers.DrinkHandlerChocolateMilk) PlantableCropPlant(powercrystals.minefactoryreloaded.farmables.plantables.PlantableCropPlant) FlipFlopJK(powercrystals.minefactoryreloaded.circuits.latch.FlipFlopJK) DrinkHandlerSewage(powercrystals.minefactoryreloaded.farmables.drinkhandlers.DrinkHandlerSewage) ItemStack(net.minecraft.item.ItemStack) LessOrEqual(powercrystals.minefactoryreloaded.circuits.logicboolean.LessOrEqual) And4(powercrystals.minefactoryreloaded.circuits.logic.And4) AdderDigitalHalf(powercrystals.minefactoryreloaded.circuits.digital.AdderDigitalHalf) And3(powercrystals.minefactoryreloaded.circuits.logic.And3) And2(powercrystals.minefactoryreloaded.circuits.logic.And2) FertilizableCropPlant(powercrystals.minefactoryreloaded.farmables.fertilizables.FertilizableCropPlant) EntityOcelot(net.minecraft.entity.passive.EntityOcelot) FruitCocoa(powercrystals.minefactoryreloaded.farmables.fruits.FruitCocoa) FertilizableCocoa(powercrystals.minefactoryreloaded.farmables.fertilizables.FertilizableCocoa) Max2(powercrystals.minefactoryreloaded.circuits.analog.Max2) Max3(powercrystals.minefactoryreloaded.circuits.analog.Max3) LatchDGated(powercrystals.minefactoryreloaded.circuits.latch.LatchDGated) PlantableNetherWart(powercrystals.minefactoryreloaded.farmables.plantables.PlantableNetherWart) GrindableStandard(powercrystals.minefactoryreloaded.farmables.grindables.GrindableStandard) SchmittTrigger(powercrystals.minefactoryreloaded.circuits.analog.SchmittTrigger) FertilizableSapling(powercrystals.minefactoryreloaded.farmables.fertilizables.FertilizableSapling) FertilizerStandard(powercrystals.minefactoryreloaded.farmables.fertilizables.FertilizerStandard) Max4(powercrystals.minefactoryreloaded.circuits.analog.Max4) RanchableSheep(powercrystals.minefactoryreloaded.farmables.ranchables.RanchableSheep) SawtoothFalling(powercrystals.minefactoryreloaded.circuits.wave.SawtoothFalling) PlantableStandard(powercrystals.minefactoryreloaded.farmables.plantables.PlantableStandard) Inverter(powercrystals.minefactoryreloaded.circuits.digital.Inverter) Min2(powercrystals.minefactoryreloaded.circuits.analog.Min2) Min3(powercrystals.minefactoryreloaded.circuits.analog.Min3) Min4(powercrystals.minefactoryreloaded.circuits.analog.Min4) EntityLivingHandler(powercrystals.minefactoryreloaded.farmables.safarinethandlers.EntityLivingHandler) GreaterOrEqual(powercrystals.minefactoryreloaded.circuits.logicboolean.GreaterOrEqual) HarvestableShrub(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableShrub) LatchSRGated(powercrystals.minefactoryreloaded.circuits.latch.LatchSRGated) Xor4(powercrystals.minefactoryreloaded.circuits.logic.Xor4) Xor3(powercrystals.minefactoryreloaded.circuits.logic.Xor3) RanchableSquid(powercrystals.minefactoryreloaded.farmables.ranchables.RanchableSquid) AdderAnalog(powercrystals.minefactoryreloaded.circuits.analog.AdderAnalog) Xor2(powercrystals.minefactoryreloaded.circuits.logic.Xor2) DrinkHandlerSludge(powercrystals.minefactoryreloaded.farmables.drinkhandlers.DrinkHandlerSludge) Nor2(powercrystals.minefactoryreloaded.circuits.logic.Nor2) FertilizableStemPlants(powercrystals.minefactoryreloaded.farmables.fertilizables.FertilizableStemPlants) SevenSegmentEncoder(powercrystals.minefactoryreloaded.circuits.digital.SevenSegmentEncoder) Fanout(powercrystals.minefactoryreloaded.circuits.Fanout) Nor4(powercrystals.minefactoryreloaded.circuits.logic.Nor4) Nor3(powercrystals.minefactoryreloaded.circuits.logic.Nor3) RandomizerDigital(powercrystals.minefactoryreloaded.circuits.digital.RandomizerDigital) HarvestableStemPlant(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableStemPlant) Sine(powercrystals.minefactoryreloaded.circuits.wave.Sine) DrinkHandlerMilk(powercrystals.minefactoryreloaded.farmables.drinkhandlers.DrinkHandlerMilk) Delay(powercrystals.minefactoryreloaded.circuits.timing.Delay) Or2(powercrystals.minefactoryreloaded.circuits.logic.Or2) Or4(powercrystals.minefactoryreloaded.circuits.logic.Or4) EntityAgeableHandler(powercrystals.minefactoryreloaded.farmables.safarinethandlers.EntityAgeableHandler) Or3(powercrystals.minefactoryreloaded.circuits.logic.Or3) HarvestableStandard(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableStandard) FertilizableGiantMushroom(powercrystals.minefactoryreloaded.farmables.fertilizables.FertilizableGiantMushroom) RanchableMooshroom(powercrystals.minefactoryreloaded.farmables.ranchables.RanchableMooshroom) Counter(powercrystals.minefactoryreloaded.circuits.digital.Counter) PlantableCocoa(powercrystals.minefactoryreloaded.farmables.plantables.PlantableCocoa) FertilizableNetherWart(powercrystals.minefactoryreloaded.farmables.fertilizables.FertilizableNetherWart) EntityWolf(net.minecraft.entity.passive.EntityWolf) Less(powercrystals.minefactoryreloaded.circuits.logicboolean.Less) Negator(powercrystals.minefactoryreloaded.circuits.analog.Negator) DeMux4(powercrystals.minefactoryreloaded.circuits.digital.DeMux4) Mux4(powercrystals.minefactoryreloaded.circuits.digital.Mux4) DrinkHandlerBiofuel(powercrystals.minefactoryreloaded.farmables.drinkhandlers.DrinkHandlerBiofuel) PassthroughRoundRobin(powercrystals.minefactoryreloaded.circuits.PassthroughRoundRobin) VanillaEggHandler(powercrystals.minefactoryreloaded.farmables.egghandlers.VanillaEggHandler) EntitySlime(net.minecraft.entity.monster.EntitySlime) Noop(powercrystals.minefactoryreloaded.circuits.Noop) DrinkHandlerPinkSlime(powercrystals.minefactoryreloaded.farmables.drinkhandlers.DrinkHandlerPinkSlime) RandomizerAnalog(powercrystals.minefactoryreloaded.circuits.analog.RandomizerAnalog) EntityChicken(net.minecraft.entity.passive.EntityChicken) Subtractor(powercrystals.minefactoryreloaded.circuits.analog.Subtractor) HarvestableVine(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableVine) MobDrop(powercrystals.minefactoryreloaded.api.MobDrop) DeMux16Analog(powercrystals.minefactoryreloaded.circuits.digital.DeMux16Analog) HarvestableCocoa(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableCocoa) Scaler(powercrystals.minefactoryreloaded.circuits.analog.Scaler) FertilizableGrass(powercrystals.minefactoryreloaded.farmables.fertilizables.FertilizableGrass) FlipFlopT(powercrystals.minefactoryreloaded.circuits.latch.FlipFlopT) Xnor4(powercrystals.minefactoryreloaded.circuits.logic.Xnor4) Xnor3(powercrystals.minefactoryreloaded.circuits.logic.Xnor3) Xnor2(powercrystals.minefactoryreloaded.circuits.logic.Xnor2) DrinkHandlerLava(powercrystals.minefactoryreloaded.farmables.drinkhandlers.DrinkHandlerLava) DrinkHandlerWater(powercrystals.minefactoryreloaded.farmables.drinkhandlers.DrinkHandlerWater) HarvestableWood(powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableWood) GrindableZombiePigman(powercrystals.minefactoryreloaded.farmables.grindables.GrindableZombiePigman) Nand2(powercrystals.minefactoryreloaded.circuits.logic.Nand2) Nand3(powercrystals.minefactoryreloaded.circuits.logic.Nand3) PassthroughGated(powercrystals.minefactoryreloaded.circuits.PassthroughGated) LatchSR(powercrystals.minefactoryreloaded.circuits.latch.LatchSR) Nand4(powercrystals.minefactoryreloaded.circuits.logic.Nand4) DrinkHandlerMushroomSoup(powercrystals.minefactoryreloaded.farmables.drinkhandlers.DrinkHandlerMushroomSoup) Greater(powercrystals.minefactoryreloaded.circuits.logicboolean.Greater) DrinkHandlerMeat(powercrystals.minefactoryreloaded.farmables.drinkhandlers.DrinkHandlerMeat) RanchableChicken(powercrystals.minefactoryreloaded.farmables.ranchables.RanchableChicken) Init(cpw.mods.fml.common.Mod.Init)

Example 9 with Init

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

the class Xycraft method load.

@Init
public static void load(FMLInitializationEvent e) {
    if (!Loader.isModLoaded("XyCraftWorld")) {
        FMLLog.warning("XyCraft missing - MFR Xycraft Compat not loading");
        return;
    }
    try {
        Class<?> blockClass = Class.forName("soaryn.xycraft.world.XyCraftWorldBlocks");
        int CornCropsID = ((Block) blockClass.getField("corn").get(null)).blockID;
        int HenequenCropsID = ((Block) blockClass.getField("henequen").get(null)).blockID;
        Class<?> itemClass = Class.forName("soaryn.xycraft.world.XyCraftWorldItems");
        int CornCropSeedId = ((Item) itemClass.getField("kernel").get(null)).itemID;
        int HenequenCropSeedId = ((Item) itemClass.getField("henequenSeeds").get(null)).itemID;
        MFRRegistry.registerHarvestable(new HarvestableXycraftCorn(CornCropsID));
        MFRRegistry.registerHarvestable(new HarvestableHenequen(HenequenCropsID));
        MFRRegistry.registerPlantable(new PlantableCropPlant(CornCropSeedId, CornCropsID));
        MFRRegistry.registerPlantable(new PlantableCropPlant(HenequenCropSeedId, HenequenCropsID));
        MFRRegistry.registerFertilizable(new FertilizableCorn(CornCropsID));
        MFRRegistry.registerFertilizable(new FertilizableHenequen(HenequenCropsID));
    } catch (Exception x) {
        x.printStackTrace();
    }
}
Also used : Item(net.minecraft.item.Item) PlantableCropPlant(powercrystals.minefactoryreloaded.farmables.plantables.PlantableCropPlant) Block(net.minecraft.block.Block) Init(cpw.mods.fml.common.Mod.Init)

Example 10 with Init

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

the class Forestry method load.

@Init
public static void load(FMLInitializationEvent e) {
    if (!Loader.isModLoaded("Forestry")) {
        FMLLog.warning("Forestry missing - MFR Forestry Compat not loading");
        return;
    }
    try {
        Class<?> forestryItems = Class.forName("forestry.core.config.ForestryItem");
        if (forestryItems != null) {
            Item peat = (Item) forestryItems.getField("peat").get(null);
            MFRRegistry.registerSludgeDrop(5, new ItemStack(peat));
        }
        MFRRegistry.registerPlantable(new PlantableForestryTree());
        MFRRegistry.registerFertilizable(new FertilizableForestryTree());
        for (Field f : Class.forName("forestry.core.config.ForestryBlock").getDeclaredFields()) {
            if (f.getName().contains("log")) {
                Block log = ((Block) f.get(null));
                if (log != null) {
                    MFRRegistry.registerHarvestable(new HarvestableForestryTree(log.blockID));
                    MFRRegistry.registerFruitLogBlockId(log.blockID);
                }
            } else if (f.getName().contains("leaves")) {
                Block leaves = ((Block) f.get(null));
                if (leaves != null) {
                    MFRRegistry.registerFruit(new FruitForestry(leaves.blockID));
                    MFRRegistry.registerFertilizable(new FertilizableForestryLeaves(leaves.blockID));
                }
            } else if (f.getName().contains("pods")) {
                Block pods = ((Block) f.get(null));
                if (pods != null) {
                    MFRRegistry.registerFruit(new FruitForestryPod(pods.blockID));
                    MFRRegistry.registerFertilizable(new FertilizableForestryPods(pods.blockID));
                }
            }
        }
        MFRRegistry.registerFertilizer(new FertilizerForestry(ForestryUtils.getItem("fertilizerCompound")));
    } catch (Exception x) {
        x.printStackTrace();
    }
}
Also used : FertilizableForestryTree(powercrystals.minefactoryreloaded.modhelpers.forestry.trees.FertilizableForestryTree) FruitForestryPod(powercrystals.minefactoryreloaded.modhelpers.forestry.pods.FruitForestryPod) FertilizableForestryPods(powercrystals.minefactoryreloaded.modhelpers.forestry.pods.FertilizableForestryPods) FertilizerForestry(powercrystals.minefactoryreloaded.modhelpers.forestry.fertilizer.FertilizerForestry) Item(net.minecraft.item.Item) Field(java.lang.reflect.Field) FruitForestry(powercrystals.minefactoryreloaded.modhelpers.forestry.leaves.FruitForestry) PlantableForestryTree(powercrystals.minefactoryreloaded.modhelpers.forestry.trees.PlantableForestryTree) Block(net.minecraft.block.Block) ItemStack(net.minecraft.item.ItemStack) HarvestableForestryTree(powercrystals.minefactoryreloaded.modhelpers.forestry.trees.HarvestableForestryTree) FertilizableForestryLeaves(powercrystals.minefactoryreloaded.modhelpers.forestry.leaves.FertilizableForestryLeaves) Init(cpw.mods.fml.common.Mod.Init) PostInit(cpw.mods.fml.common.Mod.PostInit)

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