Search in sources :

Example 26 with EventHandler

use of cpw.mods.fml.common.Mod.EventHandler in project LogisticsPipes by RS485.

the class LogisticsPipes method postInit.

@EventHandler
public void postInit(FMLPostInitializationEvent event) {
    postInitRun.stream().forEach(Runnable::run);
    postInitRun = null;
    SpecialInventoryHandlerManager.load();
    SpecialTankHandlerManager.load();
    SimpleServiceLocator.buildCraftProxy.registerPipeInformationProvider();
    SimpleServiceLocator.buildCraftProxy.initProxy();
    SimpleServiceLocator.thermalDynamicsProxy.registerPipeInformationProvider();
    SimpleServiceLocator.specialpipeconnection.registerHandler(new TeleportPipes());
    SimpleServiceLocator.specialtileconnection.registerHandler(new TesseractConnection());
    SimpleServiceLocator.specialtileconnection.registerHandler(new EnderIOHyperCubeConnection());
    SimpleServiceLocator.specialtileconnection.registerHandler(new EnderIOTransceiverConnection());
    SimpleServiceLocator.addCraftingRecipeProvider(LogisticsWrapperHandler.getWrappedRecipeProvider("BuildCraft|Factory", "AutoWorkbench", AutoWorkbench.class));
    SimpleServiceLocator.addCraftingRecipeProvider(LogisticsWrapperHandler.getWrappedRecipeProvider("BuildCraft|Silicon", "AssemblyAdvancedWorkbench", AssemblyAdvancedWorkbench.class));
    if (SimpleServiceLocator.buildCraftProxy.getAssemblyTableProviderClass() != null) {
        SimpleServiceLocator.addCraftingRecipeProvider(LogisticsWrapperHandler.getWrappedRecipeProvider("BuildCraft|Silicon", "AssemblyTable", SimpleServiceLocator.buildCraftProxy.getAssemblyTableProviderClass()));
    }
    SimpleServiceLocator.addCraftingRecipeProvider(LogisticsWrapperHandler.getWrappedRecipeProvider("Railcraft", "RollingMachine", RollingMachine.class));
    SimpleServiceLocator.addCraftingRecipeProvider(LogisticsWrapperHandler.getWrappedRecipeProvider("Tubestuff", "ImmibisCraftingTableMk2", ImmibisCraftingTableMk2.class));
    SimpleServiceLocator.addCraftingRecipeProvider(new SolderingStation());
    SimpleServiceLocator.addCraftingRecipeProvider(new LogisticsCraftingTable());
    SimpleServiceLocator.machineProgressProvider.registerProgressProvider(LogisticsWrapperHandler.getWrappedProgressProvider("Forestry", "Generic", ForestryProgressProvider.class));
    SimpleServiceLocator.machineProgressProvider.registerProgressProvider(LogisticsWrapperHandler.getWrappedProgressProvider("ThermalExpansion", "Generic", ThermalExpansionProgressProvider.class));
    SimpleServiceLocator.machineProgressProvider.registerProgressProvider(LogisticsWrapperHandler.getWrappedProgressProvider("IC2", "Generic", IC2ProgressProvider.class));
    SimpleServiceLocator.machineProgressProvider.registerProgressProvider(LogisticsWrapperHandler.getWrappedProgressProvider("EnderIO", "Generic", EnderIOProgressProvider.class));
    SimpleServiceLocator.machineProgressProvider.registerProgressProvider(LogisticsWrapperHandler.getWrappedProgressProvider("endercore", "Generic", EnderCoreProgressProvider.class));
    MainProxy.proxy.registerTileEntities();
    //Registering special particles
    MainProxy.proxy.registerParticles();
    //init Fluids
    FluidIdentifier.initFromForge(false);
    versionChecker = VersionChecker.runVersionCheck();
}
Also used : EnderIOHyperCubeConnection(logisticspipes.proxy.specialconnection.EnderIOHyperCubeConnection) TesseractConnection(logisticspipes.proxy.specialconnection.TesseractConnection) EnderIOProgressProvider(logisticspipes.proxy.enderio.EnderIOProgressProvider) AssemblyAdvancedWorkbench(logisticspipes.proxy.recipeproviders.AssemblyAdvancedWorkbench) EnderCoreProgressProvider(logisticspipes.proxy.endercore.EnderCoreProgressProvider) ImmibisCraftingTableMk2(logisticspipes.proxy.recipeproviders.ImmibisCraftingTableMk2) ThermalExpansionProgressProvider(logisticspipes.proxy.te.ThermalExpansionProgressProvider) AutoWorkbench(logisticspipes.proxy.recipeproviders.AutoWorkbench) RollingMachine(logisticspipes.proxy.recipeproviders.RollingMachine) SolderingStation(logisticspipes.proxy.recipeproviders.SolderingStation) TeleportPipes(logisticspipes.proxy.specialconnection.TeleportPipes) EnderIOTransceiverConnection(logisticspipes.proxy.specialconnection.EnderIOTransceiverConnection) IC2ProgressProvider(logisticspipes.proxy.ic2.IC2ProgressProvider) LogisticsCraftingTable(logisticspipes.proxy.recipeproviders.LogisticsCraftingTable) ForestryProgressProvider(logisticspipes.proxy.forestry.ForestryProgressProvider) EventHandler(cpw.mods.fml.common.Mod.EventHandler)

Example 27 with EventHandler

use of cpw.mods.fml.common.Mod.EventHandler in project OpenLights by PC-Logix.

the class OpenLights method load.

@EventHandler
public void load(FMLInitializationEvent event) {
    ItemStack redDye = new ItemStack(Items.dye, 1, 1);
    ItemStack greenDye = new ItemStack(Items.dye, 1, 2);
    ItemStack blueDye = new ItemStack(Items.dye, 1, 4);
    ItemStack glowDust = new ItemStack(Items.glowstone_dust);
    ItemStack pcb = li.cil.oc.api.Items.get("printedCircuitBoard").createItemStack(1);
    ItemStack glassPane = new ItemStack(Blocks.glass_pane);
    GameRegistry.addShapelessRecipe(new ItemStack(prismaticPaste, 4), redDye, greenDye, blueDye, glowDust);
    GameRegistry.addRecipe(new ItemStack(openLightBlock, 1), " G ", "GPG", " C ", 'G', glassPane, 'P', prismaticPaste, 'C', pcb);
}
Also used : ItemStack(net.minecraft.item.ItemStack) EventHandler(cpw.mods.fml.common.Mod.EventHandler)

Example 28 with EventHandler

use of cpw.mods.fml.common.Mod.EventHandler in project SecurityCraft by Geforce132.

the class mod_SecurityCraft method preInit.

@EventHandler
public void preInit(FMLPreInitializationEvent event) {
    log("Starting to load....");
    log("Loading config file....");
    log(mod_SecurityCraft.VERSION + " of SecurityCraft is for a post MC-1.6.4 version! Configuration files are useless for setting anything besides options.");
    mod_SecurityCraft.configFile = new Configuration(event.getSuggestedConfigurationFile());
    this.configHandler.setupConfiguration();
    log("Config file loaded.");
    log("Setting up handlers!");
    this.configHandler.setupHandlers(event);
    log("Handlers registered.");
    log("Setting up network....");
    mod_SecurityCraft.network = NetworkRegistry.INSTANCE.newSimpleChannel(mod_SecurityCraft.MODID);
    this.configHandler.setupPackets(mod_SecurityCraft.network);
    log("Network setup.");
    log("Loading mod additions...");
    this.configHandler.setupAdditions();
    if (this.debuggingMode) {
        this.configHandler.setupDebugAdditions();
    }
    log("Finished loading mod additions.");
    log("Doing registering stuff... (PT 1/2)");
    this.configHandler.setupGameRegistry();
    ModMetadata modMeta = event.getModMetadata();
    modMeta.authorList = Arrays.asList(new String[] { "Geforce" });
    modMeta.autogenerated = false;
    modMeta.credits = "Thanks to all of you guys for your support!";
    modMeta.description = "Adds a load of things to keep your house safe with.\nIf you like this mod, hit the green arrow\nin the corner of the forum thread!\nPlease visit the URL above for help. \n \nMessage of the update: \n" + MOTU;
    modMeta.url = "http://geforce.freeforums.org";
}
Also used : Configuration(net.minecraftforge.common.config.Configuration) ModMetadata(cpw.mods.fml.common.ModMetadata) ForgeEventHandler(org.freeforums.geforce.securitycraft.handlers.ForgeEventHandler) EventHandler(cpw.mods.fml.common.Mod.EventHandler)

Example 29 with EventHandler

use of cpw.mods.fml.common.Mod.EventHandler in project Engine by VoltzEngine-Project.

the class Engine method serverStarting.

@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
    if (!CommandVE.disableCommands) {
        // Setup command
        ICommandManager commandManager = FMLCommonHandler.instance().getMinecraftServerInstance().getCommandManager();
        ServerCommandManager serverCommandManager = ((ServerCommandManager) commandManager);
        //Register commands
        serverCommandManager.registerCommand(CommandVE.INSTANCE);
    }
    for (int i = 0; i < actionProcessorThreads; i++) {
        Thread thread = new WorkerThread("" + i);
        thread.start();
    }
}
Also used : ServerCommandManager(net.minecraft.command.ServerCommandManager) IWorkerThread(com.builtbroken.mc.api.process.IWorkerThread) WorkerThread(com.builtbroken.mc.lib.world.edit.thread.WorkerThread) ICommandManager(net.minecraft.command.ICommandManager) IWorkerThread(com.builtbroken.mc.api.process.IWorkerThread) WorkerThread(com.builtbroken.mc.lib.world.edit.thread.WorkerThread) EventHandler(cpw.mods.fml.common.Mod.EventHandler)

Example 30 with EventHandler

use of cpw.mods.fml.common.Mod.EventHandler in project Engine by VoltzEngine-Project.

the class Engine method init.

@EventHandler
public void init(FMLInitializationEvent evt) {
    Engine.metadata.modId = References.NAME;
    Engine.metadata.name = References.NAME;
    Engine.metadata.description = References.NAME + " is a content creation toolkit";
    Engine.metadata.url = "http://www.builtbroken.com";
    Engine.metadata.version = References.VERSION;
    Engine.metadata.authorList = Arrays.asList("DarkCow");
    Engine.metadata.autogenerated = false;
    //Late registration of content
    if ((getConfig().hasKey("Content", "LoadOres") || metallicOresRequested) && getConfig().getBoolean("LoadOres", "Content", metallicOresRequested, "Loads up ore blocks and generators. Ore Generation can be disable separate if you want to keep the block for legacy purposes.")) {
        ore = contentRegistry.newBlock("veStoneOre", new BlockOre("stone"), ItemBlockOre.class);
        MetallicOres.registerSet(ore, getConfig());
    }
    if ((getConfig().hasKey("Content", "LoadGemOres") || gemOresRequested) && getConfig().getBoolean("LoadGemOres", "Content", gemOresRequested, "Loads up Gem Ores.")) {
        gemOre = contentRegistry.newBlock("veGemOre", new BlockGemOre("stone"), ItemBlockGemOre.class);
        GemOres.registerSet(gemOre, getConfig());
        for (GemTypes types : GemTypes.values()) {
            if (types.isRequested()) {
                types.item = new ItemGem(types);
                contentRegistry.newItem("Gem" + LanguageUtility.capitalizeFirst(types.name) + "Item", types.item);
                for (Gems gem : Gems.values()) {
                    if (gem != Gems.UNKNOWN) {
                        OreDictionary.registerOre(types.oreDict + gem.getOreName(), types.stack(gem));
                    }
                }
            }
        }
    }
    if (multiBlockRequested) {
        multiBlock = new BlockMultiblock();
        GameRegistry.registerBlock(multiBlock, ItemBlockMulti.class, "veMultiBlock");
        NEIProxy.hideItem(multiBlock);
        EnumMultiblock.register();
    }
    boolean forceLoadSheetMetal = (sheetMetalRequested || getConfig().hasKey("SheetMetalContent", "ForceLoad")) && getConfig().getBoolean("ForceLoad", "SheetMetalContent", true, "Forces the sheet metal items to load even if not requests. Content can still loaded if false as long as another mod requests the content for crafting. This config is designed to prevent items from vanishing in saves.");
    boolean forceLoadSimpleTools = (simpleToolsRequested || getConfig().hasKey("SimpleToolsContent", "ForceLoad")) && getConfig().getBoolean("ForceLoad", "SimpleToolsContent", true, "Forces the simple tools items to load even if not requests. Content can still loaded if false as long as another mod requests the content for crafting. This config is designed to prevent items from vanishing in saves.");
    boolean forceLoadCircuits = (circuitsRequested || getConfig().hasKey("Content", "LoadCircuits")) && getConfig().getBoolean("LoadCircuits", "Content", true, "Forces the circuit items to load even if not requests. Content can still loaded if false as long as another mod requests the content for crafting. This config is designed to prevent items from vanishing in saves.");
    boolean forceLoadCraftingParts = (craftingPartsRequested || getConfig().hasKey("Content", "LoadCraftingParts")) && getConfig().getBoolean("LoadCraftingParts", "Content", true, "Forces the crafting items(Motors, coils, simple electrical parts) to load even if not requests. Content can still loaded if false as long as another mod requests the content for crafting. This config is designed to prevent items from vanishing in saves.");
    if (sheetMetalRequested || forceLoadSheetMetal) {
        itemSheetMetalTools = getManager().newItem("veSheetMetalTools", ItemSheetMetalTools.class);
        itemSheetMetal = getManager().newItem("veSheetMetal", ItemSheetMetal.class);
    }
    if (circuitsRequested || forceLoadCircuits) {
        itemCircuits = getManager().newItem("veCircuits", ItemCircuits.class);
    }
    if (craftingPartsRequested || forceLoadCraftingParts) {
        itemCraftingParts = getManager().newItem("veCraftingParts", ItemCraftingParts.class);
    }
    if (simpleToolsRequested || forceLoadSimpleTools) {
        itemSimpleCraftingTools = getManager().newItem("veSimpleTools", ItemSimpleCraftingTool.class);
    }
    if (getConfig().getBoolean("LoadHeatedRocks", "Content", heatedRockRequested, "Loads up heated rocks which are used to give explosions an extra short term effect on stone.")) {
        heatedStone = contentRegistry.newBlock("VEHeatedRock", BlockHeatedStone.class, ItemBlockMetadata.class);
        NEIProxy.hideItem(heatedStone);
        if (enabledHeatMap) {
            HeatedBlockRegistry.addNewHeatingConversion(Blocks.stone, new PlacementDataExtended(heatedStone, 15, Block.getIdFromBlock(Blocks.stone)), 600);
            HeatedBlockRegistry.addNewHeatingConversion(Blocks.cobblestone, new PlacementDataExtended(heatedStone, 15, Block.getIdFromBlock(Blocks.cobblestone)), 600);
        }
    } else {
        HeatedBlockRegistry.addNewHeatingConversion(Blocks.stone, new PlacementData(Blocks.cobblestone, 1), 600);
    }
    logger.info("Starting resource generator");
    long start = System.nanoTime();
    for (DefinedGenItems genItem : DefinedGenItems.values()) {
        if ((getConfig().hasKey("ForceLoadContent", genItem.name) || genItem.isRequested()) && getConfig().getBoolean(genItem.name, "ForceLoadContent", genItem.isRequested(), "Forces the items to load even if not requests. Content can still loaded if false as long as another mod requests the content for crafting. This config is designed to prevent items from vanishing in saves.") || genItem.isRequested()) {
            logger.info("\tGenerating " + genItem.name);
            genItem.item = getManager().newItem("ve" + LanguageUtility.capitalizeFirst(genItem.name), new ItemGenMaterial(genItem));
            for (GenMaterial mat : GenMaterial.values()) {
                if (mat == GenMaterial.UNKNOWN || genItem.ignoreMaterials.contains(mat)) {
                    NEIProxy.hideItem(new ItemStack(genItem.item, 1, mat.ordinal()));
                } else {
                    OreDictionary.registerOre(genItem.oreDict + LanguageUtility.capitalizeFirst(mat.name().toLowerCase()), genItem.stack(mat));
                }
            }
            if (genItem == DefinedGenItems.INGOT && getConfig().getBoolean("EnableCheapSteelRecipe", "Content", true, "Enables iron ingot to steel ingot smelting recipe. Only disable if another recipe for steel exists or most items will be uncraftable.")) {
                //TODO check to make sure doesn't conflict
                GameRegistry.addSmelting(Items.iron_ingot, genItem.stack(GenMaterial.STEEL), 0f);
            }
        }
    }
    if (metallicOresRequested) {
        //Register alt ore names
        OreDictionary.registerOre("oreBauxite", MetallicOres.BAUXITE.stack());
        OreDictionary.registerOre("oreMagnesite", MetallicOres.MAGNESITE.stack());
    }
    logger.info("Done... Took " + StringHelpers.formatTimeDifference(start, System.nanoTime()));
    loader.init();
    getManager().fireInit();
}
Also used : ItemSheetMetal(com.builtbroken.mc.core.content.resources.items.ItemSheetMetal) ItemGenMaterial(com.builtbroken.mc.core.content.resources.items.ItemGenMaterial) ItemSimpleCraftingTool(com.builtbroken.mc.core.content.tool.ItemSimpleCraftingTool) BlockOre(com.builtbroken.mc.core.content.resources.ore.BlockOre) ItemBlockOre(com.builtbroken.mc.core.content.resources.ore.ItemBlockOre) ItemCircuits(com.builtbroken.mc.core.content.parts.ItemCircuits) ItemBlockOre(com.builtbroken.mc.core.content.resources.ore.ItemBlockOre) GenMaterial(com.builtbroken.mc.core.content.resources.GenMaterial) ItemGenMaterial(com.builtbroken.mc.core.content.resources.items.ItemGenMaterial) BlockHeatedStone(com.builtbroken.mc.core.content.blocks.BlockHeatedStone) PlacementDataExtended(com.builtbroken.mc.lib.world.edit.PlacementDataExtended) PlacementData(com.builtbroken.mc.lib.world.edit.PlacementData) BlockMultiblock(com.builtbroken.mc.framework.multiblock.BlockMultiblock) ItemSheetMetalTools(com.builtbroken.mc.core.content.tool.ItemSheetMetalTools) DefinedGenItems(com.builtbroken.mc.core.content.resources.DefinedGenItems) ItemCraftingParts(com.builtbroken.mc.core.content.parts.ItemCraftingParts) MRHandlerItemStack(com.builtbroken.mc.lib.recipe.item.MRHandlerItemStack) ItemStack(net.minecraft.item.ItemStack) ItemBlockMetadata(com.builtbroken.mc.prefab.tile.item.ItemBlockMetadata) EventHandler(cpw.mods.fml.common.Mod.EventHandler)

Aggregations

EventHandler (cpw.mods.fml.common.Mod.EventHandler)34 ItemStack (net.minecraft.item.ItemStack)9 WorldConversionEventHandler (com.bluepowermod.convert.WorldConversionEventHandler)4 BPEventHandler (com.bluepowermod.event.BPEventHandler)4 MRHandlerItemStack (com.builtbroken.mc.lib.recipe.item.MRHandlerItemStack)4 Configuration (net.minecraftforge.common.config.Configuration)4 ServerCommandManager (net.minecraft.command.ServerCommandManager)3 IWorkerThread (com.builtbroken.mc.api.process.IWorkerThread)2 MissingMapping (cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping)2 ICommandManager (net.minecraft.command.ICommandManager)2 AMConfig (am2.configuration.AMConfig)1 SkillConfiguration (am2.configuration.SkillConfiguration)1 GUIHandler (com.bluepowermod.client.gui.GUIHandler)1 Config (com.bluepowermod.init.Config)1 RedstoneProviderQmunityLib (com.bluepowermod.redstone.RedstoneProviderQmunityLib)1 RedstoneProviderVanilla (com.bluepowermod.redstone.RedstoneProviderVanilla)1 WorldGenerationHandler (com.bluepowermod.world.WorldGenerationHandler)1 ProxyASMTest (com.builtbroken.mc.core.asm.ProxyASMTest)1 BlockHeatedStone (com.builtbroken.mc.core.content.blocks.BlockHeatedStone)1 ItemDevData (com.builtbroken.mc.core.content.debug.ItemDevData)1