Search in sources :

Example 1 with FertilizableSaplingReflection

use of powercrystals.minefactoryreloaded.modhelpers.FertilizableSaplingReflection 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)

Aggregations

Init (cpw.mods.fml.common.Mod.Init)1 Method (java.lang.reflect.Method)1 Block (net.minecraft.block.Block)1 Item (net.minecraft.item.Item)1 HarvestableStandard (powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableStandard)1 HarvestableTreeLeaves (powercrystals.minefactoryreloaded.farmables.harvestables.HarvestableTreeLeaves)1 PlantableStandard (powercrystals.minefactoryreloaded.farmables.plantables.PlantableStandard)1 FertilizableCropReflection (powercrystals.minefactoryreloaded.modhelpers.FertilizableCropReflection)1 FertilizableSaplingReflection (powercrystals.minefactoryreloaded.modhelpers.FertilizableSaplingReflection)1