use of powercrystals.minefactoryreloaded.modhelpers.forestry.fertilizer.FertilizerForestry 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();
}
}
Aggregations