Search in sources :

Example 6 with HarvestableStandard

use of powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableStandard 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 7 with HarvestableStandard

use of powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableStandard 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)

Example 8 with HarvestableStandard

use of powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableStandard 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

HarvestableStandard (powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableStandard)8 Init (cpw.mods.fml.common.Mod.Init)7 Block (net.minecraft.block.Block)5 HarvestableTreeLeaves (powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableTreeLeaves)5 PlantableStandard (powercrystals.minefactoryreloaded.farmables.plantables.PlantableStandard)5 Method (java.lang.reflect.Method)4 ItemStack (net.minecraft.item.ItemStack)4 Item (net.minecraft.item.Item)3 PlantableCropPlant (powercrystals.minefactoryreloaded.farmables.plantables.PlantableCropPlant)3 FertilizableCropReflection (powercrystals.minefactoryreloaded.modhelpers.FertilizableCropReflection)2 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 HarvestType (powercrystals.minefactoryreloaded.api.HarvestType)1 MobDrop (powercrystals.minefactoryreloaded.api.MobDrop)1 Fanout (powercrystals.minefactoryreloaded.circuits.Fanout)1 Noop (powercrystals.minefactoryreloaded.circuits.Noop)1 Passthrough (powercrystals.minefactoryreloaded.circuits.Passthrough)1 PassthroughGated (powercrystals.minefactoryreloaded.circuits.PassthroughGated)1