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();
}
}
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();
}
}
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();
}
}
Aggregations