Search in sources :

Example 6 with PlantableStandard

use of powercrystals.minefactoryreloaded.farmables.plantables.PlantableStandard 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)6 HarvestableTreeLeaves (powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableTreeLeaves)6 PlantableStandard (powercrystals.minefactoryreloaded.farmables.plantables.PlantableStandard)6 HarvestableStandard (powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableStandard)5 ItemStack (net.minecraft.item.ItemStack)4 Method (java.lang.reflect.Method)3 Block (net.minecraft.block.Block)3 Item (net.minecraft.item.Item)2 FertilizerStandard (powercrystals.minefactoryreloaded.farmables.fertilizables.FertilizerStandard)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 PassthroughRoundRobin (powercrystals.minefactoryreloaded.circuits.PassthroughRoundRobin)1