Search in sources :

Example 6 with EventHandler

use of cpw.mods.fml.common.Mod.EventHandler in project PneumaticCraft by MineMaarten.

the class PneumaticCraft method PreInit.

@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());
}
Also used : WorldGeneratorPneumaticCraft(pneumaticCraft.common.worldgen.WorldGeneratorPneumaticCraft) EventHandlerUniversalSensor(pneumaticCraft.common.EventHandlerUniversalSensor) Config(pneumaticCraft.common.config.Config) CreativeTabPneumaticCraft(pneumaticCraft.client.CreativeTabPneumaticCraft) CraftingHandler(pneumaticCraft.common.recipes.CraftingHandler) EventHandlerPneumaticCraft(pneumaticCraft.common.EventHandlerPneumaticCraft) DroneSpecialVariableHandler(pneumaticCraft.common.event.DroneSpecialVariableHandler) TickHandlerPneumaticCraft(pneumaticCraft.common.TickHandlerPneumaticCraft) EventHandler(cpw.mods.fml.common.Mod.EventHandler)

Example 7 with EventHandler

use of cpw.mods.fml.common.Mod.EventHandler in project ArsMagica2 by Mithion.

the class AMCore method preInit.

@EventHandler
public void preInit(FMLPreInitializationEvent event) {
    String configBase = event.getSuggestedConfigurationFile().getAbsolutePath();
    configBase = popPathFolder(configBase);
    compendiumBase = popPathFolder(configBase);
    configBase += File.separatorChar + "AM2" + File.separatorChar;
    config = new AMConfig(new File(configBase + File.separatorChar + "AM2.cfg"));
    skillConfig = new SkillConfiguration(new File(configBase + "SkillConf.cfg"));
    AMNetHandler.INSTANCE.init();
    proxy.InitializeAndRegisterHandlers();
    proxy.preinit();
}
Also used : SkillConfiguration(am2.configuration.SkillConfiguration) File(java.io.File) AMConfig(am2.configuration.AMConfig) EventHandler(cpw.mods.fml.common.Mod.EventHandler)

Example 8 with EventHandler

use of cpw.mods.fml.common.Mod.EventHandler in project ArsMagica2 by Mithion.

the class AMCore method init.

@EventHandler
public void init(FMLInitializationEvent event) {
    FMLInterModComms.sendMessage("Waila", "register", "am2.interop.WailaSupport.callbackRegister");
    ForgeChunkManager.setForcedChunkLoadingCallback(this, AMChunkLoader.INSTANCE);
    proxy.init();
    initAPI();
    if (AMCore.config.getEnableWitchwoodForest()) {
        BiomeDictionary.registerBiomeType(BiomeWitchwoodForest.instance, Type.FOREST, Type.MAGICAL);
        BiomeManager.warmBiomes.add(new BiomeEntry(BiomeWitchwoodForest.instance, 6));
    }
}
Also used : BiomeEntry(net.minecraftforge.common.BiomeManager.BiomeEntry) EventHandler(cpw.mods.fml.common.Mod.EventHandler)

Example 9 with EventHandler

use of cpw.mods.fml.common.Mod.EventHandler in project ArsMagica2 by Mithion.

the class AMCore method postInit.

@EventHandler
public void postInit(FMLPostInitializationEvent event) {
    //Register Flicker Operators
    registerFlickerOperators();
    proxy.setCompendiumSaveBase(compendiumBase);
    proxy.postinit();
    if (config.retroactiveWorldgen()) {
        LogHelper.info("Retroactive Worldgen is enabled");
    }
    FluidContainerRegistry.registerFluidContainer(new FluidContainerData(FluidRegistry.getFluidStack(BlockLiquidEssence.liquidEssenceFluid.getName(), FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(ItemsCommonProxy.itemAMBucket), FluidContainerRegistry.EMPTY_BUCKET));
    SeventhSanctum.instance.init();
    /*if (Loader.isModLoaded("BetterDungeons"))
			BetterDungeons.init();*/
    if (Loader.isModLoaded("Thaumcraft"))
        TC4Interop.initialize();
/*if (Loader.isModLoaded("MineFactoryReloaded"))
			MFRInterop.init();*/
}
Also used : FluidContainerData(net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData) ItemStack(net.minecraft.item.ItemStack) EventHandler(cpw.mods.fml.common.Mod.EventHandler)

Example 10 with EventHandler

use of cpw.mods.fml.common.Mod.EventHandler in project ArsMagica2 by Mithion.

the class AMCore method onIMCReceived.

@EventHandler
public void onIMCReceived(FMLInterModComms.IMCEvent event) {
    for (IMCMessage msg : event.getMessages()) {
        if (msg.key == "dsb") {
            LogHelper.info("Received dimension spawn blacklist IMC!  Processing.");
            String[] split = msg.getStringValue().split("|");
            if (split.length != 2) {
                LogHelper.warn("Could not parse dsb IMC - malformed identifiers!  Syntax is 'ClassName|DimensionID', for example:  EntityDryad|22");
                continue;
            }
            try {
                SpawnBlacklists.addBlacklistedDimensionSpawn(split[0], Integer.parseInt(split[1]));
            } catch (NumberFormatException nex) {
                LogHelper.warn("Could not parse dsb IMC - improper dimension ID (not a number)!  Syntax is 'ClassName|DimensionID', for example:  EntityDryad|22");
            }
        } else if (msg.key == "bsb") {
            LogHelper.info("Received biome spawn blacklist IMC!  Processing.");
            String[] split = msg.getStringValue().split("|");
            if (split.length != 2) {
                LogHelper.warn("Could not parse bsb IMC - malformed identifiers!  Syntax is 'ClassName|BiomeID', for example:  EntityDryad|22");
                continue;
            }
            try {
                SpawnBlacklists.addBlacklistedBiomeSpawn(split[0], Integer.parseInt(split[1]));
            } catch (NumberFormatException nex) {
                LogHelper.warn("Could not parse bsb IMC - improper biome ID (not a number)!  Syntax is 'ClassName|BiomeID', for example:  EntityDryad|22");
            }
        } else if (msg.key == "dwg") {
            LogHelper.info("Received dimension worldgen blacklist IMC!  Processing.");
            try {
                SpawnBlacklists.addBlacklistedDimensionForWorldgen(Integer.parseInt(msg.getStringValue()));
            } catch (NumberFormatException nex) {
                LogHelper.warn("Could not parse dwg IMC - improper dimension ID (not a number)!  Syntax is 'dimensionID', for example:  2");
            }
        } else if (msg.key == "adb") {
            LogHelper.info("Received dispel blacklist IMC!  Processing.");
            try {
                BuffList.instance.addDispelExclusion(Integer.parseInt(msg.getStringValue()));
            } catch (NumberFormatException nex) {
                LogHelper.warn("Could not parse adb IMC - improper potion ID (not a number)!  Syntax is 'potionID', for example:  10");
            }
        }
    }
}
Also used : IMCMessage(cpw.mods.fml.common.event.FMLInterModComms.IMCMessage) 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