use of cpw.mods.fml.common.Mod.Init in project MineFactoryReloaded by powercrystals.
the class BackTools method load.
@SuppressWarnings({ "rawtypes", "unchecked" })
@Init
public static void load(FMLInitializationEvent e) {
if (!Loader.isModLoaded("mod_BackTools")) {
FMLLog.warning("BackTools missing - MFR BackTools Compat not loading");
return;
}
try {
Class modBackTools = Class.forName("mod_BackTools");
/*
* addBackItem(Class itemClass, int orientation, boolean flipped)
* orientation is 0-3, and rotates counterclockwise by 90 deg * orientation
* flipped true for vertical flipping of the texture
*/
Method addBackItem = modBackTools.getMethod("addBackItem", Class.class, int.class, boolean.class);
if (addBackItem != null) {
addBackItem.invoke(modBackTools, ItemSafariNetLauncher.class, 2, true);
addBackItem.invoke(modBackTools, ItemSpyglass.class, 1, true);
addBackItem.invoke(modBackTools, ItemFactoryHammer.class, 1, true);
}
} catch (Exception x) {
System.out.println("Last updated for " + lastUpdated);
x.printStackTrace();
}
}
use of cpw.mods.fml.common.Mod.Init in project MineFactoryReloaded by powercrystals.
the class MineFactoryReloadedCore method init.
@Init
public void init(FMLInitializationEvent evt) {
instance = this;
float meatNuggetSaturation = MFRConfig.meatSaturation.getBoolean(false) ? 0.1F : 0.2F;
float meatIngotSaturation = MFRConfig.meatSaturation.getBoolean(false) ? 0.2F : 0.8F;
conveyorBlock = new BlockConveyor(MFRConfig.conveyorBlockId.getInt());
machineBlocks.put(0, new BlockFactoryMachine(MFRConfig.machineBlock0Id.getInt(), 0));
machineBlocks.put(1, new BlockFactoryMachine(MFRConfig.machineBlock1Id.getInt(), 1));
machineBlocks.put(2, new BlockFactoryMachine(MFRConfig.machineBlock2Id.getInt(), 2));
factoryGlassBlock = new BlockFactoryGlass(MFRConfig.factoryGlassBlockId.getInt());
factoryGlassPaneBlock = new BlockFactoryGlassPane(MFRConfig.factoryGlassPaneBlockId.getInt());
factoryRoadBlock = new BlockFactoryRoad(MFRConfig.factoryRoadBlockId.getInt());
factoryDecorativeBrickBlock = new BlockFactoryDecorativeBricks(MFRConfig.factoryDecorativeBrickBlockId.getInt());
factoryDecorativeStoneBlock = new BlockDecorativeStone(MFRConfig.factoryDecorativeStoneBlockId.getInt());
rubberWoodBlock = new BlockRubberWood(MFRConfig.rubberWoodBlockId.getInt());
rubberLeavesBlock = new BlockRubberLeaves(MFRConfig.rubberLeavesBlockId.getInt());
rubberSaplingBlock = new BlockRubberSapling(MFRConfig.rubberSaplingBlockId.getInt());
railDropoffCargoBlock = new BlockRailCargoDropoff(MFRConfig.railDropoffCargoBlockId.getInt());
railPickupCargoBlock = new BlockRailCargoPickup(MFRConfig.railPickupCargoBlockId.getInt());
railDropoffPassengerBlock = new BlockRailPassengerDropoff(MFRConfig.railDropoffPassengerBlockId.getInt());
railPickupPassengerBlock = new BlockRailPassengerPickup(MFRConfig.railPickupPassengerBlockId.getInt());
rednetCableBlock = new BlockRedNetCable(MFRConfig.rednetCableBlockId.getInt());
rednetLogicBlock = new BlockRedNetLogic(MFRConfig.rednetLogicBlockId.getInt());
rednetPanelBlock = new BlockRedNetPanel(MFRConfig.rednetPanelBlockId.getInt());
fakeLaserBlock = new BlockFakeLaser(MFRConfig.fakeLaserBlockId.getInt());
vineScaffoldBlock = new BlockVineScaffold(MFRConfig.vineScaffoldBlockId.getInt());
factoryHammerItem = (new ItemFactoryHammer(MFRConfig.hammerItemId.getInt())).setUnlocalizedName("mfr.hammer").setMaxStackSize(1);
fertilizerItem = (new ItemFactory(MFRConfig.fertilizerItemId.getInt())).setUnlocalizedName("mfr.fertilizer");
plasticSheetItem = (new ItemFactory(MFRConfig.plasticSheetItemId.getInt())).setUnlocalizedName("mfr.plastic.sheet");
rawPlasticItem = (new ItemFactory(MFRConfig.rawPlasticItemId.getInt())).setUnlocalizedName("mfr.plastic.raw");
rubberBarItem = (new ItemFactory(MFRConfig.rubberBarItemId.getInt())).setUnlocalizedName("mfr.rubber.bar");
syringeEmptyItem = (new ItemFactory(MFRConfig.syringeEmptyItemId.getInt())).setUnlocalizedName("mfr.syringe.empty");
syringeHealthItem = (new ItemSyringeHealth()).setUnlocalizedName("mfr.syringe.health").setContainerItem(syringeEmptyItem);
syringeGrowthItem = (new ItemSyringeGrowth()).setUnlocalizedName("mfr.syringe.growth").setContainerItem(syringeEmptyItem);
rawRubberItem = (new ItemFactory(MFRConfig.rawRubberItemId.getInt())).setUnlocalizedName("mfr.rubber.raw");
machineBaseItem = (new ItemFactory(MFRConfig.machineBaseItemId.getInt())).setUnlocalizedName("mfr.machineblock");
safariNetItem = (new ItemSafariNet(MFRConfig.safariNetItemId.getInt())).setUnlocalizedName("mfr.safarinet.reusable");
ceramicDyeItem = (new ItemCeramicDye(MFRConfig.ceramicDyeItemId.getInt())).setUnlocalizedName("mfr.ceramicdye");
blankRecordItem = (new ItemFactory(MFRConfig.blankRecordId.getInt())).setUnlocalizedName("mfr.record.blank").setMaxStackSize(1);
syringeZombieItem = (new ItemSyringeZombie()).setUnlocalizedName("mfr.syringe.zombie").setContainerItem(syringeEmptyItem);
safariNetSingleItem = (new ItemSafariNet(MFRConfig.safariNetSingleItemId.getInt())).setUnlocalizedName("mfr.safarinet.singleuse");
upgradeItem = (new ItemUpgrade(MFRConfig.upgradeItemId.getInt())).setUnlocalizedName("mfr.upgrade.radius").setMaxStackSize(1);
safariNetLauncherItem = (new ItemSafariNetLauncher(MFRConfig.safariNetLauncherItemId.getInt())).setUnlocalizedName("mfr.safarinet.launcher").setMaxStackSize(1);
sugarCharcoalItem = (new ItemFactory(MFRConfig.sugarCharcoalItemId.getInt())).setUnlocalizedName("mfr.sugarcharcoal");
milkBottleItem = (new ItemMilkBottle(MFRConfig.milkBottleItemId.getInt())).setUnlocalizedName("mfr.milkbottle").setMaxStackSize(16);
spyglassItem = (new ItemSpyglass(MFRConfig.spyglassItemId.getInt())).setUnlocalizedName("mfr.spyglass").setMaxStackSize(1);
portaSpawnerItem = (new ItemPortaSpawner(MFRConfig.portaSpawnerItemId.getInt())).setUnlocalizedName("mfr.portaspawner").setMaxStackSize(1);
strawItem = (new ItemStraw(MFRConfig.strawItemId.getInt())).setUnlocalizedName("mfr.straw").setMaxStackSize(1);
xpExtractorItem = (new ItemXpExtractor(MFRConfig.xpExtractorItemId.getInt())).setUnlocalizedName("mfr.xpextractor").setMaxStackSize(1);
syringeSlimeItem = (new ItemSyringeSlime(MFRConfig.syringeSlimeItemId.getInt())).setUnlocalizedName("mfr.syringe.slime").setContainerItem(syringeEmptyItem);
syringeCureItem = (new ItemSyringeCure(MFRConfig.syringeCureItemId.getInt())).setUnlocalizedName("mfr.syringe.cure").setContainerItem(syringeEmptyItem);
logicCardItem = (new ItemLogicUpgradeCard(MFRConfig.logicCardItemId.getInt())).setUnlocalizedName("mfr.upgrade.logic").setMaxStackSize(1);
rednetMeterItem = (new ItemRedNetMeter(MFRConfig.rednetMeterItemId.getInt())).setUnlocalizedName("mfr.rednet.meter").setMaxStackSize(1);
rednetMemoryCardItem = (new ItemRedNetMemoryCard(MFRConfig.rednetMemoryCardItemId.getInt())).setUnlocalizedName("mfr.rednet.memorycard").setMaxStackSize(1);
rulerItem = (new ItemRuler(MFRConfig.rulerItemId.getInt())).setUnlocalizedName("mfr.ruler").setMaxStackSize(1);
meatIngotRawItem = (new ItemFactoryFood(MFRConfig.meatIngotRawItemId.getInt(), 4, meatIngotSaturation)).setUnlocalizedName("mfr.meat.ingot.raw");
meatIngotCookedItem = (new ItemFactoryFood(MFRConfig.meatIngotCookedItemId.getInt(), 10, meatIngotSaturation)).setUnlocalizedName("mfr.meat.ingot.cooked");
meatNuggetRawItem = (new ItemFactoryFood(MFRConfig.meatNuggetRawItemId.getInt(), 1, meatNuggetSaturation)).setUnlocalizedName("mfr.meat.nugget.raw");
meatNuggetCookedItem = (new ItemFactoryFood(MFRConfig.meatNuggetCookedItemId.getInt(), 4, meatNuggetSaturation)).setUnlocalizedName("mfr.meat.nugget.cooked");
pinkSlimeballItem = (new ItemFactory(MFRConfig.pinkSlimeballItemId.getInt())).setUnlocalizedName("mfr.pinkslimeball");
safariNetJailerItem = (new ItemSafariNet(MFRConfig.safariNetJailerItemId.getInt())).setUnlocalizedName("mfr.safarinet.jailer");
laserFocusItem = (new ItemLaserFocus(MFRConfig.laserFocusItemId.getInt())).setUnlocalizedName("mfr.laserfocus").setMaxStackSize(1);
needlegunItem = (new ItemNeedleGun(MFRConfig.needlegunItemId.getInt())).setUnlocalizedName("mfr.needlegun").setMaxStackSize(1);
needlegunAmmoEmptyItem = (new ItemFactory(MFRConfig.needlegunAmmoEmptyItemId.getInt())).setUnlocalizedName("mfr.needlegun.ammo.empty");
needlegunAmmoStandardItem = (new ItemNeedlegunAmmoStandard(MFRConfig.needlegunAmmoStandardItemId.getInt())).setUnlocalizedName("mfr.needlegun.ammo.standard");
needlegunAmmoLavaItem = (new ItemNeedlegunAmmoBlock(MFRConfig.needlegunAmmoLavaItemId.getInt(), Block.lavaMoving.blockID, 3)).setUnlocalizedName("mfr.needlegun.ammo.lava");
needlegunAmmoSludgeItem = (new ItemNeedlegunAmmoBlock(MFRConfig.needlegunAmmoSludgeItemId.getInt(), sludgeLiquid.blockID, 6)).setUnlocalizedName("mfr.needlegun.ammo.sludge");
needlegunAmmoSewageItem = (new ItemNeedlegunAmmoBlock(MFRConfig.needlegunAmmoSewageItemId.getInt(), sewageLiquid.blockID, 6)).setUnlocalizedName("mfr.needlegun.ammo.sewage");
needlegunAmmoFireItem = (new ItemNeedlegunAmmoFire(MFRConfig.needlegunAmmoFireItemId.getInt())).setUnlocalizedName("mfr.needlegun.ammo.fire");
needlegunAmmoAnvilItem = (new ItemNeedlegunAmmoBlock(MFRConfig.needlegunAmmoAnvilItemId.getInt(), Block.anvil.blockID, 2)).setUnlocalizedName("mfr.needlegun.ammo.anvil").setMaxDamage(0);
plasticCup = (ItemFactoryCup) new ItemFactoryCup(MFRConfig.plasticCupItemId.getInt(), 64, 16).setUnlocalizedName("mfr.bucket.plasticcup");
rocketLauncherItem = (new ItemRocketLauncher(MFRConfig.rocketLauncherItemId.getInt())).setUnlocalizedName("mfr.rocketlauncher").setMaxStackSize(1);
rocketItem = (new ItemRocket(MFRConfig.rocketItemId.getInt())).setUnlocalizedName("mfr.rocket").setMaxStackSize(16);
for (Entry<Integer, Block> machine : machineBlocks.entrySet()) {
GameRegistry.registerBlock(machine.getValue(), ItemBlockFactoryMachine.class, machine.getValue().getUnlocalizedName());
}
GameRegistry.registerBlock(conveyorBlock, ItemBlockConveyor.class, conveyorBlock.getUnlocalizedName());
GameRegistry.registerBlock(factoryGlassBlock, ItemBlockFactoryGlass.class, factoryGlassBlock.getUnlocalizedName());
GameRegistry.registerBlock(factoryGlassPaneBlock, ItemBlockFactoryGlassPane.class, factoryGlassPaneBlock.getUnlocalizedName());
GameRegistry.registerBlock(factoryRoadBlock, ItemBlockFactoryRoad.class, factoryRoadBlock.getUnlocalizedName());
GameRegistry.registerBlock(factoryDecorativeBrickBlock, ItemBlockFactoryDecorativeBrick.class, factoryDecorativeBrickBlock.getUnlocalizedName());
GameRegistry.registerBlock(factoryDecorativeStoneBlock, ItemBlockDecorativeStone.class, factoryDecorativeStoneBlock.getUnlocalizedName());
GameRegistry.registerBlock(rubberWoodBlock, rubberWoodBlock.getUnlocalizedName());
GameRegistry.registerBlock(rubberLeavesBlock, rubberLeavesBlock.getUnlocalizedName());
GameRegistry.registerBlock(rubberSaplingBlock, rubberSaplingBlock.getUnlocalizedName());
GameRegistry.registerBlock(railPickupCargoBlock, railPickupCargoBlock.getUnlocalizedName());
GameRegistry.registerBlock(railDropoffCargoBlock, railDropoffCargoBlock.getUnlocalizedName());
GameRegistry.registerBlock(railPickupPassengerBlock, railPickupPassengerBlock.getUnlocalizedName());
GameRegistry.registerBlock(railDropoffPassengerBlock, railDropoffPassengerBlock.getUnlocalizedName());
GameRegistry.registerBlock(rednetCableBlock, rednetCableBlock.getUnlocalizedName());
GameRegistry.registerBlock(rednetLogicBlock, ItemBlockRedNetLogic.class, rednetLogicBlock.getUnlocalizedName());
GameRegistry.registerBlock(rednetPanelBlock, ItemBlockRedNetPanel.class, rednetPanelBlock.getUnlocalizedName());
GameRegistry.registerBlock(vineScaffoldBlock, ItemBlockVineScaffold.class, vineScaffoldBlock.getUnlocalizedName());
GameRegistry.registerBlock(milkLiquid, milkLiquid.getUnlocalizedName());
GameRegistry.registerBlock(sludgeLiquid, sludgeLiquid.getUnlocalizedName());
GameRegistry.registerBlock(sewageLiquid, sewageLiquid.getUnlocalizedName());
GameRegistry.registerBlock(essenceLiquid, essenceLiquid.getUnlocalizedName());
GameRegistry.registerBlock(biofuelLiquid, biofuelLiquid.getUnlocalizedName());
GameRegistry.registerBlock(meatLiquid, meatLiquid.getUnlocalizedName());
GameRegistry.registerBlock(pinkSlimeLiquid, pinkSlimeLiquid.getUnlocalizedName());
GameRegistry.registerBlock(chocolateMilkLiquid, chocolateMilkLiquid.getUnlocalizedName());
GameRegistry.registerBlock(mushroomSoupLiquid, mushroomSoupLiquid.getUnlocalizedName());
Block.setBurnProperties(rubberWoodBlock.blockID, 4, 20);
Block.setBurnProperties(rubberLeavesBlock.blockID, 30, 20);
MinecraftForge.setBlockHarvestLevel(MineFactoryReloadedCore.rednetCableBlock, 0, "pickaxe", 0);
if (MFRConfig.vanillaOverrideGlassPane.getBoolean(true)) {
Block.blocksList[Block.thinGlass.blockID] = null;
Item.itemsList[Block.thinGlass.blockID] = null;
Block.thinGlass = new BlockVanillaGlassPane();
GameRegistry.registerBlock(Block.thinGlass, Block.thinGlass.getUnlocalizedName());
}
if (MFRConfig.vanillaOverrideIce.getBoolean(true)) {
Block.blocksList[Block.ice.blockID] = null;
Item.itemsList[Block.ice.blockID] = null;
Block.ice = new BlockVanillaIce();
GameRegistry.registerBlock(Block.ice, ItemBlockVanillaIce.class, "blockVanillaIce");
}
GameRegistry.registerTileEntity(TileEntityConveyor.class, "factoryConveyor");
GameRegistry.registerTileEntity(TileEntityRedNetCable.class, "factoryRedstoneCable");
GameRegistry.registerTileEntity(TileEntityRedNetLogic.class, "factoryRednetLogic");
GameRegistry.registerTileEntity(TileEntityRedNetHistorian.class, "factoryRednetHistorian");
EntityRegistry.registerModEntity(EntitySafariNet.class, "entitySafariNet", 0, instance, 160, 5, true);
EntityRegistry.registerModEntity(EntityPinkSlime.class, "mfrEntityPinkSlime", 1, instance, 160, 5, true);
EntityRegistry.registerModEntity(EntityNeedle.class, "mfrEntityNeedle", 2, instance, 160, 5, true);
EntityRegistry.registerModEntity(EntityRocket.class, "mfrEntityRocket", 3, instance, 160, 1, true);
MinecraftForge.EVENT_BUS.register(instance);
MinecraftForge.EVENT_BUS.register(proxy);
OreDictionary.registerOre("itemRubber", MineFactoryReloadedCore.rubberBarItem);
OreDictionary.registerOre("woodRubber", MineFactoryReloadedCore.rubberWoodBlock);
OreDictionary.registerOre("sheetPlastic", MineFactoryReloadedCore.plasticSheetItem);
OreDictionary.registerOre("dustPlastic", MineFactoryReloadedCore.rawPlasticItem);
OreDictionary.registerOre("ingotMeat", MineFactoryReloadedCore.meatIngotCookedItem);
OreDictionary.registerOre("ingotMeatRaw", MineFactoryReloadedCore.meatIngotRawItem);
OreDictionary.registerOre("nuggetMeat", MineFactoryReloadedCore.meatNuggetCookedItem);
OreDictionary.registerOre("nuggetMeatRaw", MineFactoryReloadedCore.meatNuggetRawItem);
OreDictionary.registerOre("itemCharcoalSugar", MineFactoryReloadedCore.sugarCharcoalItem);
OreDictionary.registerOre("cableRedNet", MineFactoryReloadedCore.rednetCableBlock);
GameRegistry.registerFuelHandler(new MineFactoryReloadedFuelHandler());
proxy.init();
NetworkRegistry.instance().registerGuiHandler(this, new MFRGUIHandler());
IBehaviorDispenseItem behavior = new BehaviorDispenseSafariNet();
BlockDispenser.dispenseBehaviorRegistry.putObject(safariNetItem, behavior);
BlockDispenser.dispenseBehaviorRegistry.putObject(safariNetSingleItem, behavior);
// Work around to make the below behavior actually /exist/ before the server starts.
DispenserBehaviors.func_96467_a();
behavior = (IBehaviorDispenseItem) BlockDispenser.dispenseBehaviorRegistry.func_82594_a(Item.bucketWater);
BlockDispenser.dispenseBehaviorRegistry.putObject(sewageBucketItem, behavior);
BlockDispenser.dispenseBehaviorRegistry.putObject(sludgeBucketItem, behavior);
BlockDispenser.dispenseBehaviorRegistry.putObject(mobEssenceBucketItem, behavior);
BlockDispenser.dispenseBehaviorRegistry.putObject(bioFuelBucketItem, behavior);
BlockDispenser.dispenseBehaviorRegistry.putObject(meatBucketItem, behavior);
BlockDispenser.dispenseBehaviorRegistry.putObject(pinkSlimeBucketItem, behavior);
BlockDispenser.dispenseBehaviorRegistry.putObject(chocolateMilkBucketItem, behavior);
BlockDispenser.dispenseBehaviorRegistry.putObject(mushroomSoupBucketItem, behavior);
ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(safariNetSingleItem), 1, 1, 25));
ChestGenHooks.getInfo(ChestGenHooks.MINESHAFT_CORRIDOR).addItem(new WeightedRandomChestContent(new ItemStack(safariNetSingleItem), 1, 1, 25));
ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_DESERT_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(safariNetSingleItem), 1, 1, 25));
VillagerRegistry.instance().registerVillageCreationHandler(new VillageCreationHandler());
VillagerRegistry.instance().registerVillagerType(MFRConfig.zoolologistEntityId.getInt(), villagerFolder + "zoologist.png");
VillagerRegistry.instance().registerVillageTradeHandler(MFRConfig.zoolologistEntityId.getInt(), new VillageTradeHandler());
GameRegistry.registerWorldGenerator(new MineFactoryReloadedWorldGen());
TickRegistry.registerScheduledTickHandler(new UpdateManager(this), Side.CLIENT);
}
use of cpw.mods.fml.common.Mod.Init in project MineFactoryReloaded by powercrystals.
the class TwilightForest method load.
@SuppressWarnings("rawtypes")
@Init
public static void load(FMLInitializationEvent e) {
if (!Loader.isModLoaded("TwilightForest")) {
FMLLog.warning("Twilight Forest missing - MFR Twilight Forest Compat not loading");
return;
}
try {
entityEggs = (HashMap) Class.forName("twilightforest.entity.TFCreatures").getField("entityEggs").get(null);
twilightForestContainer = FMLCommonHandler.instance().findContainerFor(Class.forName("twilightforest.TwilightForestMod").getField("instance").get(null));
Class tfBighorn = Class.forName("twilightforest.entity.passive.EntityTFBighorn");
Class tfBoar = Class.forName("twilightforest.entity.passive.EntityTFBoar");
Class tfDeer = Class.forName("twilightforest.entity.passive.EntityTFDeer");
Class tfHydra = Class.forName("twilightforest.entity.EntityTFHydra");
Class tfHydraHead = Class.forName("twilightforest.entity.EntityTFHydraHead");
Class tfHydraNeck = Class.forName("twilightforest.entity.EntityTFHydraNeck");
Class tfHydraPart = Class.forName("twilightforest.entity.EntityTFHydraPart");
Class tfKingSpider = Class.forName("twilightforest.entity.EntityTFKingSpider");
Class tfLich = Class.forName("twilightforest.entity.EntityTFLich");
Class tfNaga = Class.forName("twilightforest.entity.EntityTFNaga");
Class tfNagaSegment = Class.forName("twilightforest.entity.EntityTFNagaSegment");
Class tfQuestRam = Class.forName("twilightforest.entity.passive.EntityTFQuestRam");
Class tfUrGhast = Class.forName("twilightforest.entity.EntityTFUrGhast");
MFRRegistry.registerSafariNetBlacklist(tfHydra);
MFRRegistry.registerSafariNetBlacklist(tfHydraHead);
MFRRegistry.registerSafariNetBlacklist(tfHydraNeck);
MFRRegistry.registerSafariNetBlacklist(tfHydraPart);
MFRRegistry.registerSafariNetBlacklist(tfKingSpider);
MFRRegistry.registerSafariNetBlacklist(tfLich);
MFRRegistry.registerSafariNetBlacklist(tfNaga);
MFRRegistry.registerSafariNetBlacklist(tfNagaSegment);
MFRRegistry.registerSafariNetBlacklist(tfQuestRam);
MFRRegistry.registerSafariNetBlacklist(tfUrGhast);
MFRRegistry.registerGrinderBlacklist(tfUrGhast);
MFRRegistry.registerGrinderBlacklist(tfNagaSegment);
MFRRegistry.registerGrinderBlacklist(tfNaga);
MFRRegistry.registerGrinderBlacklist(tfLich);
MFRRegistry.registerGrinderBlacklist(tfHydraPart);
MFRRegistry.registerGrinderBlacklist(tfHydraNeck);
MFRRegistry.registerGrinderBlacklist(tfHydraHead);
MFRRegistry.registerGrinderBlacklist(tfHydra);
MFRRegistry.registerMobEggHandler(new TwilightForestEggHandler());
MFRRegistry.registerBreederFood(tfBighorn, new ItemStack(Item.wheat));
MFRRegistry.registerBreederFood(tfBoar, new ItemStack(Item.carrot));
MFRRegistry.registerBreederFood(tfDeer, new ItemStack(Item.wheat));
MFRRegistry.registerRanchable(new RanchableTFBighorn(tfBighorn));
Class tfBlocks = Class.forName("twilightforest.block.TFBlocks");
if (tfBlocks != null) {
MFRRegistry.registerHarvestable(new HarvestableStandard(((Block) tfBlocks.getField("log").get(null)).blockID, HarvestType.Tree));
MFRRegistry.registerHarvestable(new HarvestableStandard(((Block) tfBlocks.getField("magicLog").get(null)).blockID, HarvestType.Tree));
MFRRegistry.registerHarvestable(new HarvestableStandard(((Block) tfBlocks.getField("magicLogSpecial").get(null)).blockID, HarvestType.Tree));
MFRRegistry.registerHarvestable(new HarvestableStandard(((Block) tfBlocks.getField("root").get(null)).blockID, HarvestType.Tree));
MFRRegistry.registerHarvestable(new HarvestableTreeLeaves(((Block) tfBlocks.getField("leaves").get(null)).blockID));
MFRRegistry.registerHarvestable(new HarvestableTreeLeaves(((Block) tfBlocks.getField("magicLeaves").get(null)).blockID));
MFRRegistry.registerHarvestable(new HarvestableTreeLeaves(((Block) tfBlocks.getField("hedge").get(null)).blockID));
MFRRegistry.registerHarvestable(new HarvestableTreeLeaves(((Block) tfBlocks.getField("firefly").get(null)).blockID));
MFRRegistry.registerHarvestable(new HarvestableTreeLeaves(((Block) tfBlocks.getField("cicada").get(null)).blockID));
MFRRegistry.registerHarvestable(new HarvestableStandard(((Block) tfBlocks.getField("plant").get(null)).blockID, HarvestType.Normal));
MFRRegistry.registerPlantable(new PlantableStandard(((Block) tfBlocks.getField("sapling").get(null)).blockID, ((Block) tfBlocks.getField("sapling").get(null)).blockID));
MFRRegistry.registerFertilizable(new FertilizableSapling(((Block) tfBlocks.getField("sapling").get(null)).blockID));
}
MFRRegistry.registerRandomMobProvider(new TwilightForestMobProvider());
} catch (Exception x) {
x.printStackTrace();
}
}
use of cpw.mods.fml.common.Mod.Init in project MineFactoryReloaded by powercrystals.
the class Pam method load.
@Init
public static void load(FMLInitializationEvent e) {
if (!Loader.isModLoaded("PamHarvestCraft")) {
FMLLog.warning("Pam's HC base missing - MFR Pam HC Compat not loading");
} else {
// Bushes
registerBush("Blackberry", true, true);
registerBush("Blueberry", true, true);
registerBush("Grape", true, true);
registerBush("Kiwi", true, true);
registerBush("Raspberry", true, true);
registerBush("Spiceleaf", true, true);
registerBush("Strawberry", true, true);
registerBush("Sunflower", false, true);
// Crops
registerCrop("Asparagus", false, false);
registerCrop("Bean", false, false);
registerCrop("Beet", false, false);
registerCrop("Bellpepper", true, false);
registerCrop("Broccoli", false, false);
registerCrop("Cantaloupe", true, false);
registerCrop("Celery", false, false);
registerCrop("Chilipepper", true, false);
registerCrop("Coffee", true, false);
registerCrop("Corn", true, false);
registerCrop("Cucumber", true, false);
registerCrop("Eggplant", true, false);
registerCrop("Garlic", false, false);
registerCrop("Ginger", false, false);
registerCrop("Lettuce", false, false);
registerCrop("Mustard", true, false);
registerCrop("Onion", false, false);
registerCrop("Peanut", false, false);
registerCrop("Peas", true, false);
registerCrop("Pineapple", false, false);
registerCrop("Radish", false, false);
registerCrop("Sweetpotato", false, false);
registerCrop("Tea", false, false);
registerCrop("Tomato", true, false);
registerCrop("Turnip", false, false);
registerCrop("Zucchini", true, false);
// misc types
registerPamMod("Candle", "Candleberry", Category.MISC, true, true, Block.tilledField.blockID);
registerMisc("Cotton", true, true);
// plants that require different base soils
registerPamMod("Rice", "Rice", Category.CROP, false, false, Block.waterStill.blockID);
registerPamMod("Cranberry", "Cranberry", Category.BUSH, false, true, Block.waterStill.blockID);
registerPamMod("Whitemushroom", "Whitemushroom", Category.BUSH, false, true, Block.wood.blockID);
registerPamMod("Rotten", "Rotten", Category.CROP, false, false, Block.slowSand.blockID);
registerPamMod("Cactusfruit", "Cactusfruit", Category.BUSH, true, true, Block.sand.blockID);
// fruits
registerFruit("Apple");
registerFruit("Avocado");
registerFruit("Banana");
registerFruit("Cherry");
registerFruit("Coconut");
registerFruit("Lemon");
registerFruit("Lime");
registerFruit("Mango");
registerFruit("Nutmeg");
registerFruit("Olive");
registerFruit("Orange");
registerFruit("Papaya");
registerFruit("Peach");
registerFruit("Pear");
registerFruit("Peppercorn");
registerFruit("Plum");
registerFruit("Pomegranate");
registerFruit("Starfruit");
registerFruit("Vanillabean");
registerFruit("Walnut");
// special case for candle and cinnamon
registerCandle();
registerCinnamon();
try {
Class<?> mod = Class.forName("mods.PamHarvestCraft.PamHarvestCraft");
MFRRegistry.registerSludgeDrop(25, new ItemStack((Item) mod.getField("saltItem").get(null)));
} catch (Exception x) {
x.printStackTrace();
}
}
if (!Loader.isModLoaded("PamWeeeFlowers")) {
FMLLog.warning("Pam's Weee! Flowers missing - MFR Pam Weee! Flowers Compat not loading");
} else {
String[] flowers = { "White", "Orange", "Magenta", "LightBlue", "Yellow", "Lime", "Pink", "LightGrey", "DarkGrey", "Cyan", "Purple", "Blue", "Brown", "Green", "Red", "Black" };
try {
Class<?> mod = Class.forName("mods.PamWeeeFlowers.PamWeeeFlowers");
MFRRegistry.registerHarvestable(new HarvestableStandard(((Block) mod.getField("pamFlower").get(null)).blockID, HarvestType.Normal));
for (String flower : flowers) {
int seedId = ((Item) mod.getField(flower.toLowerCase() + "flowerseedItem").get(null)).itemID;
int blockId = ((Block) mod.getField("pam" + flower.toLowerCase() + "flowerCrop").get(null)).blockID;
Method fertilize = Class.forName("mods.PamWeeeFlowers.BlockPamFlowerCrop").getMethod("fertilize", World.class, int.class, int.class, int.class);
MFRRegistry.registerPlantable(new PlantableCropPlant(seedId, blockId));
MFRRegistry.registerHarvestable(new HarvestablePams(blockId));
MFRRegistry.registerFertilizable(new FertilizableCropReflection(blockId, fertilize, 7));
}
} catch (ClassNotFoundException x) {
FMLLog.warning("Unable to load Pam support for Weee! Flowers even though Weee! FLowers was present");
} catch (Exception x) {
x.printStackTrace();
}
}
}
use of cpw.mods.fml.common.Mod.Init in project MineFactoryReloaded by powercrystals.
the class Railcraft method load.
@Init
public void load(FMLInitializationEvent evt) {
if (!Loader.isModLoaded("Railcraft")) {
FMLLog.warning("Railcraft missing - MFR Railcraft Compat not loading");
// why warn?
return;
}
try {
int id = MineFactoryReloadedCore.factoryDecorativeStoneBlock.blockID;
FMLInterModComms.sendMessage("Railcraft", "balast", String.format("%s@%s", id, 8));
FMLInterModComms.sendMessage("Railcraft", "balast", String.format("%s@%s", id, 9));
// white sand? black sand?
Object rockCrusher = Class.forName("mods.railcraft.api.crafting.RailcraftCraftingManager").getField("rockCrusher").get(null);
Method createNewRecipe = Class.forName("mods.railcraft.api.crafting.IRockCrusherCraftingManager").getMethod("createNewRecipe", ItemStack.class, boolean.class, boolean.class);
Method addOutput = Class.forName("mods.railcraft.api.crafting.IRockCrusherRecipe").getMethod("addOutput", ItemStack.class, float.class);
Object recipe = createNewRecipe.invoke(rockCrusher, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 10), true, false);
// Paved Blackstone -> Cobble
addOutput.invoke(recipe, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 2), 1.0f);
recipe = createNewRecipe.invoke(rockCrusher, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 11), true, false);
// Paved Whitestone -> Cobble
addOutput.invoke(recipe, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 3), 1.0f);
recipe = createNewRecipe.invoke(rockCrusher, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 0), true, false);
// Smooth Blackstone -> Cobble
addOutput.invoke(recipe, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 2), 1.0f);
recipe = createNewRecipe.invoke(rockCrusher, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 1), true, false);
// Smooth Whitestone -> Cobble
addOutput.invoke(recipe, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 3), 1.0f);
recipe = createNewRecipe.invoke(rockCrusher, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 2), true, false);
// Cobble Blackstone -> Gravel + flint
addOutput.invoke(recipe, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 8), 1.0f);
addOutput.invoke(recipe, new ItemStack(Item.flint, 1, 0), 0.05f);
recipe = createNewRecipe.invoke(rockCrusher, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 3), true, false);
// Cobble Whitestone -> Gravel + flint
addOutput.invoke(recipe, new ItemStack(MineFactoryReloadedCore.factoryDecorativeStoneBlock, 1, 9), 1.0f);
addOutput.invoke(recipe, new ItemStack(Item.flint, 1, 0), 0.05f);
} catch (Throwable _) {
ModContainer This = FMLCommonHandler.instance().findContainerFor(this);
FMLLog.log(This.getModId(), Level.SEVERE, "There was a problem loading %s.", This.getName());
_.printStackTrace();
}
}
Aggregations