cpw.mods.fml.common.Mod.EventHandler Java Examples
The following examples show how to use
cpw.mods.fml.common.Mod.EventHandler.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PneumaticCraft.java From PneumaticCraft with GNU General Public License v3.0 | 6 votes |
@EventHandler public void postInit(FMLPostInitializationEvent event){ //Add these later so we include other mod's storage recipes. // CraftingRegistrator.addPressureChamberStorageBlockRecipes(); CraftingRegistrator.addAssemblyCombinedRecipes(); HeatExchangerManager.getInstance().init(); FluidFuelManager.registerFuels(); ThirdPartyManager.instance().postInit(); proxy.postInit(); Config.postInit(); AmadronOfferManager.getInstance().shufflePeriodicOffers(); AmadronOfferManager.getInstance().recompileOffers(); CraftingRegistrator.addProgrammingPuzzleRecipes(); }
Example #2
Source File: OpenPeripheralCore.java From OpenPeripheral with MIT License | 6 votes |
@EventHandler public void processMessage(FMLInterModComms.IMCEvent event) { for (FMLInterModComms.IMCMessage m : event.getMessages()) { if (m.isStringMessage()) { if (Constants.IMC_IGNORE.equalsIgnoreCase(m.key)) { TileEntityBlacklist.INSTANCE.addToBlacklist(m.getStringValue()); } else if (Constants.IMC_NAME_CLASS.equalsIgnoreCase(m.key)) { String value = m.getStringValue(); String[] fields = value.split("\\s+"); if (fields.length != 2) { Log.warn("Invalid IMC from %s: can't decode type '%s'", m.getSender(), value); } else { PeripheralTypeProvider.INSTANCE.setType(fields[0], fields[1]); } } } } }
Example #3
Source File: Chisel.java From Chisel-2 with GNU General Public License v2.0 | 6 votes |
@EventHandler public void preInit(FMLPreInitializationEvent event) { File configFile = event.getSuggestedConfigurationFile(); Configurations.configExists = configFile.exists(); Configurations.config = new Configuration(configFile); Configurations.config.load(); Configurations.refreshConfig(); ChiselTabs.preInit(); Features.preInit(); Statistics.init(); PacketHandler.init(); ChiselController.INSTANCE.preInit(); if (Loader.isModLoaded("ForgeMultipart")) { new FMPCompat().init(); } proxy.preInit(); }
Example #4
Source File: ElectroMagicTools.java From Electro-Magic-Tools with GNU General Public License v3.0 | 6 votes |
@EventHandler public void load(FMLInitializationEvent event) { ElectroMagicTools.logger.info(localize("console.EMT.init.begin")); ElectroMagicTools.logger.info(localize("console.EMT.init.loadProxies")); proxy.load(); ElectroMagicTools.logger.info(localize("console.EMT.init.mobDrops")); MinecraftForge.EVENT_BUS.register(new EntityEventHandler()); ElectroMagicTools.logger.info(localize("console.EMT.init.loot")); DungeonChestGenerator.generateLoot(); ElectroMagicTools.logger.info(localize("console.EMT.init.entities")); BaseEntityRegistry.registerEMTEntities(); ElectroMagicTools.logger.info(localize("console.EMT.init.guiHandler")); NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy); ElectroMagicTools.logger.info(localize("console.EMT.init.end")); }
Example #5
Source File: EtFuturum.java From Et-Futurum with The Unlicense | 6 votes |
@EventHandler public void postInit(FMLPostInitializationEvent event) { Items.blaze_rod.setFull3D(); Blocks.trapped_chest.setCreativeTab(CreativeTabs.tabRedstone); if (enableUpdatedFoodValues) { setFinalField(ItemFood.class, Items.carrot, 3, "healAmount", "field_77853_b"); setFinalField(ItemFood.class, Items.baked_potato, 5, "healAmount", "field_77853_b"); } if (enableUpdatedHarvestLevels) { Blocks.packed_ice.setHarvestLevel("pickaxe", 0); Blocks.ladder.setHarvestLevel("axe", 0); Blocks.melon_block.setHarvestLevel("axe", 0); } }
Example #6
Source File: EtFuturum.java From Et-Futurum with The Unlicense | 6 votes |
@EventHandler public void init(FMLInitializationEvent event) { NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy); ModRecipes.init(); proxy.registerEvents(); proxy.registerEntities(); proxy.registerRenderers(); if (ModEntityList.hasEntitiesWithEggs()) { ModEntityList.entity_egg = new ItemEntityEgg(); GameRegistry.registerItem(ModEntityList.entity_egg, "entity_egg"); OreDictionary.registerOre("mobEgg", ModEntityList.entity_egg); } isTinkersConstructLoaded = Loader.isModLoaded("TConstruct"); }
Example #7
Source File: MyTown.java From MyTown2 with The Unlicense | 6 votes |
@EventHandler public void preInit(FMLPreInitializationEvent ev) { // Setup Loggers LOG = ev.getModLog(); Constants.CONFIG_FOLDER = ev.getModConfigurationDirectory().getPath() + "/MyTown/"; // Read Configs Config.instance.init(Constants.CONFIG_FOLDER + "/MyTown.cfg", Constants.MODID); LOCAL = new Local(Constants.CONFIG_FOLDER+"/localization/", Config.instance.localization.get(), "/mytown/localization/", MyTown.class); LocalManager.register(LOCAL, "mytown"); registerHandlers(); // Register ICrashCallable's FMLCommonHandler.instance().registerCrashCallable(new DatasourceCrashCallable()); }
Example #8
Source File: BRLoader.java From BigReactors with MIT License | 6 votes |
@EventHandler public void preInit(FMLPreInitializationEvent event) { BigReactors.registerOres(0, true); BigReactors.registerIngots(0); BigReactors.registerFuelRods(0, true); BigReactors.registerReactorPartBlocks(0, true); BigReactors.registerTurbineParts(); BigReactors.registerDevices(0, true); BigReactors.registerFluids(0, true); BigReactors.registerCreativeParts(0, true); BigReactors.registerItems(); StandardReactants.register(); BigReactors.eventHandler = new BREventHandler(); MinecraftForge.EVENT_BUS.register(BigReactors.eventHandler); MinecraftForge.EVENT_BUS.register(proxy); multiblockEventHandler = new MultiblockEventHandler(); MinecraftForge.EVENT_BUS.register(multiblockEventHandler); proxy.preInit(); Fluid waterFluid = FluidRegistry.WATER; // Force-load water to prevent startup crashes }
Example #9
Source File: BurlapCraft.java From burlapcraft with GNU Lesser General Public License v3.0 | 6 votes |
@EventHandler public void serverLoad(FMLServerStartingEvent event) { // register server commands event.registerServerCommand(new CommandTeleport()); event.registerServerCommand(new CommandSmoothMove()); event.registerServerCommand(new CommandAStar()); event.registerServerCommand(new CommandBFS()); event.registerServerCommand(new CommandVI()); event.registerServerCommand(new CommandRMax()); event.registerServerCommand(new CommandCreateDungeons()); event.registerServerCommand(new CommandInventory()); event.registerServerCommand(new CommandCheckState()); event.registerServerCommand(new CommandResetDungeon()); event.registerServerCommand(new CommandCheckProps()); event.registerServerCommand(new CommandTest()); event.registerServerCommand(new CommandTerminalExplore()); event.registerServerCommand(new CommandCurrentPath()); event.registerServerCommand(new CommandReachable()); }
Example #10
Source File: Extracells.java From ExtraCells1 with MIT License | 6 votes |
@EventHandler public void init(FMLInitializationEvent event) { proxy.RegisterItems(); proxy.RegisterBlocks(); proxy.RegisterRenderers(); proxy.RegisterTileEntities(); proxy.addRecipes(); if (!debug) Util.addBasicBlackList(ItemEnum.FLUIDDISPLAY.getItemInstance().itemID, OreDictionary.WILDCARD_VALUE); Util.getCellRegistry().addCellHandler(new FluidCellHandler()); LanguageRegistry.instance().addStringLocalization("itemGroup.Extra_Cells", "en_US", "Extra Cells"); renderID = RenderingRegistry.getNextAvailableRenderId(); RenderHandler handler = new RenderHandler(renderID); RenderingRegistry.registerBlockHandler(handler); // WAILA Support FMLInterModComms.sendMessage("Waila", "register", "extracells.integration.WAILA.WailaDataProvider.callbackRegister"); // AE Spatial Storage Support proxy.registerMovables(); }
Example #11
Source File: Forbidden.java From ForbiddenMagic with Do What The F*ck You Want To Public License | 6 votes |
@EventHandler public void prelude(FMLPreInitializationEvent event) { instance = this; Config.configurate(event.getSuggestedConfigurationFile()); if (Config.wrathCage) crysTab = new CreativeTabs("mobcrystal"){ @Override public Item getTabIconItem() { return ForbiddenItems.mobCrystal; } }; Compat.initiate(); DarkAspects.initAspects(); Config.spawnilify(); ForbiddenItems.addItems(); ForbiddenBlocks.addBlocks(); DarkEnchantments.hex(); if(Compat.bm) DarkPotions.alchemize(); proxy.registerRenderInfo(); }
Example #12
Source File: GTNEIOrePlugin.java From GTNEIOrePlugin with MIT License | 6 votes |
@EventHandler public void onLoadComplete(FMLLoadCompleteEvent event) { if (event.getSide() == Side.CLIENT) { try { Class clazzGT6API = Class.forName("gregapi.GT_API"); GTVersion = "GT6"; } catch (ClassNotFoundException e) {} if (GTVersion.equals("GT5")) { new GT5OreLayerHelper(); new GT5OreSmallHelper(); } else { new GT6OreLayerHelper(); new GT6OreSmallHelper(); new GT6OreBedrockHelper(); } } }
Example #13
Source File: PneumaticCraft.java From PneumaticCraft with GNU General Public License v3.0 | 5 votes |
@EventHandler public void PreInit(FMLPreInitializationEvent event){ event.getModMetadata().version = Versions.fullVersionString(); isNEIInstalled = Loader.isModLoaded(ModIds.NEI); PneumaticRegistry.init(PneumaticCraftAPIHandler.getInstance()); UpgradeRenderHandlerList.init(); SensorHandler.init(); Config.init(event.getSuggestedConfigurationFile()); ThirdPartyManager.instance().index(); NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy); tabPneumaticCraft = new CreativeTabPneumaticCraft("tabPneumaticCraft"); Fluids.initFluids(); Blockss.init(); Itemss.init(); HackableHandler.addDefaultEntries(); ModuleRegistrator.init(); WidgetRegistrator.init(); ThirdPartyManager.instance().preInit(); TileEntityRegistrator.init(); EntityRegistrator.init(); SemiBlockInitializer.init(); CraftingRegistrator.init(); VillagerHandler.instance().init(); GameRegistry.registerWorldGenerator(new WorldGeneratorPneumaticCraft(), 0); AchievementHandler.init(); HeatBehaviourManager.getInstance().init(); proxy.registerRenders(); proxy.registerHandlers(); tickHandler = new TickHandlerPneumaticCraft(); FMLCommonHandler.instance().bus().register(tickHandler); MinecraftForge.EVENT_BUS.register(new EventHandlerPneumaticCraft()); MinecraftForge.EVENT_BUS.register(new EventHandlerUniversalSensor()); MinecraftForge.EVENT_BUS.register(new DroneSpecialVariableHandler()); FMLCommonHandler.instance().bus().register(new CraftingHandler()); FMLCommonHandler.instance().bus().register(new Config()); }
Example #14
Source File: Forbidden.java From ForbiddenMagic with Do What The F*ck You Want To Public License | 5 votes |
@EventHandler public void crescendo(FMLInitializationEvent event) { events = new FMEventHandler(); MinecraftForge.EVENT_BUS.register(events); FMLCommonHandler.instance().bus().register(events); VillagerRegistry.instance().registerVillagerId(Config.hereticID); VillagerRegistry.instance().registerVillageTradeHandler(Config.hereticID, new VillagerHereticManager()); }
Example #15
Source File: OpenPeripheralAddons.java From OpenPeripheral-Addons with MIT License | 5 votes |
@EventHandler public void init(FMLInitializationEvent evt) { proxy.init(); proxy.registerRenderInformation(); OpcAccess.checkApiPresent(); OpcAccess.adapterRegistry.register(new AdapterSensor()); OpcAccess.itemStackMetaBuilder.register(new ItemTerminalMetaProvider()); OpcAccess.itemStackMetaBuilder.register(new NbtTerminalMetaProvider()); if (Loader.isModLoaded(Mods.COMPUTERCRAFT)) ModuleComputerCraft.init(); }
Example #16
Source File: NEIIntegration.java From NEI-Integration with MIT License | 5 votes |
@EventHandler public void preInit(FMLPreInitializationEvent evt) { if (evt.getSide() != Side.CLIENT) { return; } log = evt.getModLog(); log.info("Starting NEI Integration"); integrations = Integrations.getIntegrations(); Config.preInit(evt); }
Example #17
Source File: exaliquo.java From Ex-Aliquo with MIT License | 5 votes |
@EventHandler public void preInit(FMLPreInitializationEvent event) { Configurations.Load(event.getModConfigurationDirectory()); Registries.exatab = new ExATab("ExA"); Registries.oretab = new ExAOreTab("ExAOres"); Registries.registerItems(); Registries.registerBlocks(); Registries.registerRecipes(); Registries.exatab.initTab(new ItemStack(Registries.crookGold, 1, 0)); Registries.oretab.initTab(new ItemStack(Registries.cobaltOreItem, 1, 0)); MinecraftForge.EVENT_BUS.register(new AliquoEvents()); TickRegistry.registerTickHandler(new AliquoTickHandler(), Side.CLIENT); }
Example #18
Source File: Chisel.java From Chisel with GNU General Public License v2.0 | 5 votes |
@EventHandler public void missingMapping(FMLMissingMappingsEvent event) { BlockNameConversion.init(); for(MissingMapping m : event.get()) { // This bug was introduced along with Chisel 1.5.2, and was fixed in 1.5.3. // Ice Stairs were called null.0-7 instead of other names, and Marble/Limestone stairs did not exist. // This fixes the bug. if(m.name.startsWith("null.") && m.name.length() == 6 && m.type == Type.BLOCK) { m.warn();//(Action.WARN); } // Fix mapping of snakestoneSand, snakestoneStone, limestoneStairs, marbleStairs when loading an old (1.5.4) save else if(m.type == Type.BLOCK) { final Block block = BlockNameConversion.findBlock(m.name); if(block != null) { m.remap(block); FMLLog.getLogger().info("Remapping block " + m.name + " to " + General.getName(block)); } else FMLLog.getLogger().warn("Block " + m.name + " could not get remapped."); } else if(m.type == Type.ITEM) { final Item item = BlockNameConversion.findItem(m.name); if(item != null) { m.remap(item); FMLLog.getLogger().info("Remapping item " + m.name + " to " + General.getName(item)); } else FMLLog.getLogger().warn("Item " + m.name + " could not get remapped."); } } }
Example #19
Source File: Chisel.java From Chisel-2 with GNU General Public License v2.0 | 5 votes |
@EventHandler public void missingMapping(FMLMissingMappingsEvent event) { BlockNameConversion.init(); for (MissingMapping m : event.get()) { // This bug was introduced along with Chisel 1.5.2, and was fixed in // 1.5.3. // Ice Stairs were called null.0-7 instead of other names, and // Marble/Limestone stairs did not exist. // This fixes the bug. if (m.name.startsWith("null.") && m.name.length() == 6 && m.type == Type.BLOCK) { m.warn();// (Action.WARN); } // Fix mapping of snakestoneSand, snakestoneStone, limestoneStairs, // marbleStairs when loading an old (1.5.4) save else if (m.type == Type.BLOCK) { final Block block = BlockNameConversion.findBlock(m.name); if (block != null) { m.remap(block); FMLLog.getLogger().info("Remapping block " + m.name + " to " + General.getName(block)); } else FMLLog.getLogger().warn("Block " + m.name + " could not get remapped."); } else if (m.type == Type.ITEM) { final Item item = BlockNameConversion.findItem(m.name); if (item != null) { m.remap(item); FMLLog.getLogger().info("Remapping item " + m.name + " to " + General.getName(item)); } else FMLLog.getLogger().warn("Item " + m.name + " could not get remapped."); } } }
Example #20
Source File: EnderStorage.java From EnderStorage with MIT License | 5 votes |
@EventHandler public void init(FMLInitializationEvent event) { loadPersonalItem(); disableVanillaEnderChest = config.getTag("disable-vanilla").setComment("Set to true to make the vanilla enderchest unplaceable.").getBooleanValue(true); removeVanillaRecipe = config.getTag("disable-vanilla_recipe").setComment("Set to true to make the vanilla enderchest uncraftable.").getBooleanValue(false); anarchyMode = config.getTag("anarchy-mode").setComment("Causes chests to lose personal settings and drop the diamond on break").getBooleanValue(false); EnderStorageManager.loadConfig(config); EnderStorageManager.registerPlugin(new EnderItemStoragePlugin()); EnderStorageManager.registerPlugin(new EnderLiquidStoragePlugin()); proxy.init(); }
Example #21
Source File: LookingGlass.java From LookingGlass with GNU General Public License v3.0 | 5 votes |
@EventHandler public void preinit(FMLPreInitializationEvent event) { //Initialize the packet handling LookingGlassPacketManager.registerPacketHandler(new PacketCreateView(), (byte) 10); LookingGlassPacketManager.registerPacketHandler(new PacketCloseView(), (byte) 11); LookingGlassPacketManager.registerPacketHandler(new PacketWorldInfo(), (byte) 100); LookingGlassPacketManager.registerPacketHandler(new PacketChunkInfo(), (byte) 101); LookingGlassPacketManager.registerPacketHandler(new PacketTileEntityNBT(), (byte) 102); LookingGlassPacketManager.registerPacketHandler(new PacketRequestWorldInfo(), (byte) 200); LookingGlassPacketManager.registerPacketHandler(new PacketRequestChunk(), (byte) 201); LookingGlassPacketManager.registerPacketHandler(new PacketRequestTE(), (byte) 202); LookingGlassPacketManager.bus = NetworkRegistry.INSTANCE.newEventDrivenChannel(LookingGlassPacketManager.CHANNEL); LookingGlassPacketManager.bus.register(new LookingGlassPacketManager()); // Load our basic configs ModConfigs.loadConfigs(new Configuration(event.getSuggestedConfigurationFile())); // Here we use the recommended config file to establish a good place to put a log file for any proxy world error logs. Used primarily to log the full errors when ticking or rendering proxy worlds. File configroot = event.getSuggestedConfigurationFile().getParentFile(); // Main tick handler. Handles FML events. FMLCommonHandler.instance().bus().register(new LookingGlassEventHandler(new File(configroot.getParentFile(), "logs/proxyworlds.log"))); // Forge event handler MinecraftForge.EVENT_BUS.register(new LookingGlassForgeEventHandler()); // Initialize the API provider system. Beware, this way be dragons. APIProviderImpl.init(); }
Example #22
Source File: OpenPeripheralCore.java From OpenPeripheral with MIT License | 5 votes |
@Mod.EventHandler public void construct(FMLConstructionEvent evt) { ArchitectureChecker.INSTANCE.register(Constants.ARCH_COMPUTER_CRAFT, new ComputerCraftChecker()); ArchitectureChecker.INSTANCE.register(Constants.ARCH_OPEN_COMPUTERS, new OpenComputersChecker()); apiSetup.setupApis(); apiSetup.installProviderAccess(); if (ArchitectureChecker.INSTANCE.isEnabled(Constants.ARCH_OPEN_COMPUTERS)) ModuleOpenComputers.init(); if (ArchitectureChecker.INSTANCE.isEnabled(Constants.ARCH_COMPUTER_CRAFT)) ModuleComputerCraft.init(); }
Example #23
Source File: Chisel.java From Chisel-2 with GNU General Public License v2.0 | 5 votes |
@EventHandler public void postInit(FMLPostInitializationEvent event) { ChiselTabs.postInit(); Compatibility.init(event); FMLLog.severe("Unable to lookup chisel:... is not an error, please do not treat it as such"); FMLLog.bigWarning("In case you didn't see the red above I suggest you read it - Cricket"); }
Example #24
Source File: ElectroMagicTools.java From Electro-Magic-Tools with GNU General Public License v3.0 | 5 votes |
@EventHandler public void postInit(FMLPostInitializationEvent event) { ElectroMagicTools.logger.info(localize("console.EMT.postInit.begin")); ModuleRegistry.registerLateModules(); RegistryHandler.registerIc2PostRegistrys(); ElectroMagicTools.logger.info(localize("console.EMT.postInit.end")); }
Example #25
Source File: ElectroMagicTools.java From Electro-Magic-Tools with GNU General Public License v3.0 | 5 votes |
@EventHandler public void preInit(FMLPreInitializationEvent event) { ElectroMagicTools.logger.info(localize("console.EMT.preInit.begin")); ConfigHandler.init(event.getSuggestedConfigurationFile()); FMLCommonHandler.instance().bus().register(new EventHandlerEMT()); ModuleRegistry.registerModules(); EssentiasOutputs.addPrimalOutputs(); EssentiasOutputs.addOutputs(); ElectroMagicTools.logger.info(localize("console.EMT.preInit.end")); }
Example #26
Source File: SimplyJetpacks.java From SimplyJetpacks with MIT License | 5 votes |
@EventHandler public static void preInit(FMLPreInitializationEvent evt) { logger = evt.getModLog(); logger.info("Starting Simply Jetpacks"); checkCoFHLib(); Packs.preInit(); Config.preInit(evt); ModItems.preInit(); }
Example #27
Source File: SimplyJetpacks.java From SimplyJetpacks with MIT License | 5 votes |
@EventHandler public static void init(FMLInitializationEvent evt) { RecipeSorter.register(SimplyJetpacks.MODID + ":upgrading", UpgradingRecipe.class, Category.SHAPED, "after:minecraft:shaped"); proxy.registerHandlers(); PacketHandler.init(); ModItems.init(); ModEnchantments.init(); }
Example #28
Source File: DragonArtifacts.java From Artifacts with MIT License | 5 votes |
@EventHandler public void PostInit(FMLPostInitializationEvent event) { baublesLoaded = Loader.isModLoaded("Baubles"); mystcraftLoaded = Loader.isModLoaded("Mystcraft"); //System.out.println("[Artifacts] Is Baubles Loaded? " + baublesLoaded); //System.out.println("[Artifacts] Is Mystcraft Loaded? " + mystcraftLoaded); }
Example #29
Source File: NBTEdit.java From NBTEdit with GNU General Public License v3.0 | 5 votes |
@EventHandler public void preInit(FMLPreInitializationEvent event){ ModMetadata modMeta = event.getModMetadata(); modMeta.authorList = Arrays.asList(new String[] { "Davidee" }); modMeta.autogenerated = false; modMeta.credits = "Thanks to Mojang, Forge, and all your support."; modMeta.description = "Allows you to edit NBT Tags in-game.\nPlease visit the URL above for help."; modMeta.url = "http://www.minecraftforum.net/topic/1558668-151/"; Configuration config = new Configuration(event.getSuggestedConfigurationFile()); config.load(); opOnly = config.get("General", "opOnly", true, "true if only Ops can NBTEdit; false allows users in creative mode to NBTEdit").getBoolean(true); config.save(); }
Example #30
Source File: NBTEdit.java From NBTEdit with GNU General Public License v3.0 | 5 votes |
@EventHandler public void serverStarting(FMLServerStartingEvent event) { MinecraftServer server= event.getServer(); ServerCommandManager serverCommandManager = (ServerCommandManager) server.getCommandManager(); serverCommandManager.registerCommand(new CommandNBTEdit()); logger.fine("Server Starting -- Added \"/nbtedit\" command"); }