Java Code Examples for cpw.mods.fml.common.event.FMLInterModComms#sendMessage()

The following examples show how to use cpw.mods.fml.common.event.FMLInterModComms#sendMessage() . 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: TERecipes.java    From SimplyJetpacks with MIT License 6 votes vote down vote up
public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {
    SimplyJetpacks.logger.info("Registering TE Induction Smelter recipe");
    
    NBTTagCompound toSend = new NBTTagCompound();
    
    toSend.setInteger("energy", energy);
    toSend.setTag("primaryInput", new NBTTagCompound());
    toSend.setTag("secondaryInput", new NBTTagCompound());
    toSend.setTag("primaryOutput", new NBTTagCompound());
    toSend.setTag("secondaryOutput", new NBTTagCompound());
    
    primaryInput.writeToNBT(toSend.getCompoundTag("primaryInput"));
    secondaryInput.writeToNBT(toSend.getCompoundTag("secondaryInput"));
    primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));
    if (secondaryOutput != null) {
        secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
        toSend.setInteger("secondaryChance", secondaryChance);
    }
    
    FMLInterModComms.sendMessage("ThermalExpansion", "SmelterRecipe", toSend);
}
 
Example 2
Source File: Extracells.java    From ExtraCells1 with MIT License 6 votes vote down vote up
@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 3
Source File: OpenPeripheralCore.java    From OpenPeripheral with MIT License 6 votes vote down vote up
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent evt) {
	apiSetup.installHolderAccess(evt.getAsmData());
	PeripheralTypeProvider.INSTANCE.initialize(evt.getModConfigurationDirectory());

	final File configFile = evt.getSuggestedConfigurationFile();
	config = new Configuration(configFile);
	ConfigProcessing.processAnnotations(ModInfo.ID, config, Config.class);
	if (config.hasChanged()) config.save();

	FeatureGroupManager.INSTANCE.loadBlacklist(Config.featureGroupsBlacklist);
	FMLCommonHandler.instance().bus().register(new ConfigGuiFactory.ConfigChangeListener(config));

	MinecraftForge.EVENT_BUS.register(TileEntityBlacklist.INSTANCE);

	FMLInterModComms.sendMessage(Mods.OPENCOMPUTERS, "blacklistPeripheral", IOpenPeripheral.class.getName());

	TypeClassifier.INSTANCE.registerClassifier(new MinecraftTypeClassifier());

	FeatureGroupManager.INSTANCE.loadFeatureGroupsFromAnnotations(evt.getAsmData());
}
 
Example 4
Source File: TERecipes.java    From SimplyJetpacks with MIT License 6 votes vote down vote up
public static void addTransposerFill(int energy, ItemStack input, ItemStack output, FluidStack fluid, boolean reversible) {
    SimplyJetpacks.logger.info("Registering TE Fluid Transposer fill recipe");
    
    NBTTagCompound toSend = new NBTTagCompound();
    
    toSend.setInteger("energy", energy);
    toSend.setTag("input", new NBTTagCompound());
    toSend.setTag("output", new NBTTagCompound());
    toSend.setTag("fluid", new NBTTagCompound());
    
    input.writeToNBT(toSend.getCompoundTag("input"));
    output.writeToNBT(toSend.getCompoundTag("output"));
    toSend.setBoolean("reversible", reversible);
    fluid.writeToNBT(toSend.getCompoundTag("fluid"));
    
    FMLInterModComms.sendMessage("ThermalExpansion", "TransposerFillRecipe", toSend);
}
 
Example 5
Source File: Chisel.java    From Chisel-2 with GNU General Public License v2.0 6 votes vote down vote up
@EventHandler
public void init(FMLInitializationEvent event) {
	Features.init();

	NetworkRegistry.INSTANCE.registerGuiHandler(this, new ChiselGuiHandler());

	addWorldgen(Features.MARBLE, ChiselBlocks.marble, Configurations.marbleAmount);
	addWorldgen(Features.LIMESTONE, ChiselBlocks.limestone, Configurations.limestoneAmount);
	addWorldgen(Features.ANDESITE, ChiselBlocks.andesite, Configurations.andesiteAmount, 40, 100, 0.5);
	addWorldgen(Features.GRANITE, ChiselBlocks.granite, Configurations.graniteAmount, 40, 100, 0.5);
	addWorldgen(Features.DIORITE, ChiselBlocks.diorite, Configurations.dioriteAmount, 40, 100, 0.5);
	GameRegistry.registerWorldGenerator(GeneratorChisel.INSTANCE, 1000);

       EntityRegistry.registerModEntity(EntityChiselSnowman.class, "snowman", 0, this, 80, 1, true);

	proxy.init();
	MinecraftForge.EVENT_BUS.register(this);
	FMLCommonHandler.instance().bus().register(instance);

	FMLInterModComms.sendMessage("Waila", "register", "com.cricketcraft.chisel.compat.WailaCompat.register");
}
 
Example 6
Source File: AdvancedMod.java    From AdvancedMod with GNU General Public License v3.0 6 votes vote down vote up
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event){
    ModBlocks.init();
    ModTileEntities.init();
    proxy.preInit();
    GameRegistry.registerWorldGenerator(new WorldGeneratorFlag(), 0);
    NetworkHandler.init();
    DescriptionHandler.init();
    NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
    MinecraftForge.EVENT_BUS.register(new AdvancedModEventHandler());//For registering events from the net.miencraftforge.event package.
    FMLCommonHandler.instance().bus().register(new AdvancedModEventHandler());//For registering events from the cpw.mods.fml.gameevent package.
    FMLInterModComms.sendMessage(Reference.MOD_ID, "camoMineBlacklist", new ItemStack(Blocks.stone));
    FMLInterModComms.sendMessage("Waila", "register", "com.minemaarten.advancedmod.thirdparty.waila.Waila.onWailaCall");
    Log.info("Pre Initialization Complete!");

    if(Loader.isModLoaded("Thaumcraft")) {
        loadThaumcraft();
    }
}
 
Example 7
Source File: EIORecipes.java    From SimplyJetpacks with MIT License 5 votes vote down vote up
public static void addAlloySmelterRecipe(String name, int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack tertiaryInput, ItemStack output) {
    SimplyJetpacks.logger.info("Registering EIO Alloy Smelter recipe");
    
    StringBuilder toSend = new StringBuilder();
    
    toSend.append("<recipeGroup name=\"" + SimplyJetpacks.MODID + "\">");
    {
        toSend.append("<recipe name=\"" + name + "\" energyCost=\"" + energy + "\">");
        {
            toSend.append("<input>");
            {
                appendItemStack(toSend, primaryInput);
                appendItemStack(toSend, secondaryInput);
                appendItemStack(toSend, tertiaryInput);
            }
            toSend.append("</input>");
            
            toSend.append("<output>");
            {
                appendItemStack(toSend, output);
            }
            toSend.append("</output>");
        }
        toSend.append("</recipe>");
    }
    toSend.append("</recipeGroup>");
    
    FMLInterModComms.sendMessage("EnderIO", "recipe:alloysmelter", toSend.toString());
}
 
Example 8
Source File: EIORecipes.java    From SimplyJetpacks with MIT License 5 votes vote down vote up
public static void addSoulBinderRecipe(String recipeID, int energy, int xp, String soulTypes, ItemStack input, ItemStack output) {
    SimplyJetpacks.logger.info("Registering EIO Soul Binder recipe");
    
    NBTTagCompound toSend = new NBTTagCompound();
    
    toSend.setString("recipeUID", recipeID);
    toSend.setInteger("requiredEnergyRF", energy);
    toSend.setInteger("requiredXP", xp);
    toSend.setString("entityTypes", soulTypes);
    writeItemStack(toSend, "inputStack", input);
    writeItemStack(toSend, "outputStack", output);
    
    FMLInterModComms.sendMessage("EnderIO", "recipe:soulbinder", toSend);
}
 
Example 9
Source File: BCRecipes.java    From SimplyJetpacks with MIT License 5 votes vote down vote up
public static void addAssemblyRecipe(String recipeId, int energy, ItemStack[] inputs, ItemStack output) {
    SimplyJetpacks.logger.info("Registering BC Assembly Table recipe");
    
    NBTTagCompound toSend = new NBTTagCompound();
    toSend.setString("id", "simplyjetpacks:" + recipeId);
    toSend.setInteger("energy", energy);
    NBTTagList inputsList = new NBTTagList();
    for (ItemStack stack : inputs) {
        inputsList.appendTag(stack.writeToNBT(new NBTTagCompound()));
    }
    toSend.setTag("input", inputsList);
    toSend.setTag("output", output.writeToNBT(new NBTTagCompound()));
    
    FMLInterModComms.sendMessage("BuildCraft|Core", "add-assembly-recipe", toSend);
}
 
Example 10
Source File: EnderIO.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
private void registerFuel(Fluid fluid, int powerPerCycle, int burnTime){
    NBTTagCompound tag = new NBTTagCompound();
    tag.setString("fluidName", fluid.getName());
    tag.setInteger("powerPerCycle", powerPerCycle);
    tag.setInteger("totalBurnTime", burnTime);
    FMLInterModComms.sendMessage(ModIds.EIO, "fluidFuel:add", tag);
}
 
Example 11
Source File: Hydraulicraft.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void preInit(){
    FMLInterModComms.sendMessage(ModIds.HC, "pneumaticCraft.common.thirdparty.hydraulicraft.Hydraulicraft", "registrarHandling");
    //pneumaticPump = new BlockPneumaticPump(Material.iron).setCreativeTab(pneumaticCraftTab).setBlockName("pneumaticPump").setHardness(3.0F).setResistance(3.0F);
    //Blockss.registerBlock(pneumaticPump);
    //GameRegistry.registerTileEntity(TileEntityPneumaticPump.class, "pneumaticPump");
    PneumaticRegistry.instance.registerBlockTrackEntry(new BlockTrackEntryHydraulicraft());
}
 
Example 12
Source File: Thaumcraft.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void preInit(){
    for(int i = 0; i < 16; i++) {
        Block plantBlock = ItemPlasticPlants.getPlantBlockIDFromSeed(i);
        if(plantBlock != null) {
            FMLInterModComms.sendMessage(ModIds.THAUMCRAFT, "harvestStandardCrop", new ItemStack(plantBlock, 1, 6));
            FMLInterModComms.sendMessage(ModIds.THAUMCRAFT, "harvestStandardCrop", new ItemStack(plantBlock, 1, 13));
        }
    }
    PneumaticRegistry.getInstance().registerBlockTrackEntry(new BlockTrackEntryThaumcraft());
}
 
Example 13
Source File: FMPIMC.java    From Chisel-2 with GNU General Public License v2.0 4 votes vote down vote up
public static void registerFMP(Block block, int meta) {
	FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(block, 1, meta));
}
 
Example 14
Source File: Gadomancy.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
    proxy.initalize();

    FMLInterModComms.sendMessage(Thaumcraft.MODID, "dimensionBlacklist", ModConfig.dimOuterId + ":0");
}
 
Example 15
Source File: ServerProxy.java    From OmniOcular with Apache License 2.0 4 votes vote down vote up
@Override
public void registerWaila() {
    FMLInterModComms.sendMessage("Waila", "register", "me.exz.omniocular.handler.EntityHandler.callbackRegister");
    FMLInterModComms.sendMessage("Waila", "register", "me.exz.omniocular.handler.TileEntityHandler.callbackRegister");
}
 
Example 16
Source File: TERecipes.java    From SimplyJetpacks with MIT License 4 votes vote down vote up
public static void addSmelterBlastOre(String oreType) {
    NBTTagCompound toSend = new NBTTagCompound();
    toSend.setString("oreType", oreType);
    FMLInterModComms.sendMessage("ThermalExpansion", "SmelterBlastOreType", toSend);
}
 
Example 17
Source File: ClientProxy.java    From OmniOcular with Apache License 2.0 4 votes vote down vote up
@Override
public void registerWaila() {
    FMLInterModComms.sendMessage("Waila", "register", "me.exz.omniocular.handler.EntityHandler.callbackRegister");
    FMLInterModComms.sendMessage("Waila", "register", "me.exz.omniocular.handler.TileEntityHandler.callbackRegister");
}
 
Example 18
Source File: IGWMod.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void clientSide(){
    FMLInterModComms.sendMessage("IGWMod", "pneumaticCraft.common.thirdparty.igwmod.IGWHandler", "init");
}
 
Example 19
Source File: Waila.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void init(){
    FMLInterModComms.sendMessage("Waila", "register", "pneumaticCraft.common.thirdparty.waila.Waila.callbackRegister");
}
 
Example 20
Source File: OpenPeripheralIntegration.java    From OpenPeripheral-Integration with MIT License 4 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent evt) {
	config = new Configuration(evt.getSuggestedConfigurationFile());

	if (config.hasCategory("integration")) {
		ConfigCategory integration = config.getCategory("integration");
		config.removeCategory(integration);
	}

	if (checkConfig(config, "vanilla")) Integration.addModule(new ModuleVanilla());
	if (checkConfig(config, "vanilla-inventory")) Integration.addModule(new ModuleVanillaInventory());
	if (checkConfig(config, "vanilla-inventory-manipulation")) Integration.addModule(new ModuleVanillaInventoryManipulation());

	if (checkConfig(config, "cofh-api-energy")) Integration.addModule(new ModuleCofhEnergy());
	if (checkConfig(config, "cofh-api-inventory")) Integration.addModule(new ModuleCofhInventory());
	if (checkConfig(config, "cofh-api-item")) Integration.addModule(new ModuleCofhItem());
	if (checkConfig(config, "cofh-api-tileentity")) Integration.addModule(new ModuleCofhTileEntity());
	if (checkConfig(config, "cofh-api-transport")) Integration.addModule(new ModuleCofhTransport());

	if (checkConfig(config, "buildcraft-api-transport")) Integration.addModule(new ModuleBuildCraftTransport());
	if (checkConfig(config, "buildcraft-api-tilenentity")) Integration.addModule(new ModuleBuildCraftTile());
	if (checkConfig(config, "buildcraft-api-facades")) Integration.addModule(new ModuleBuildCraftFacades());

	if (checkConfig(config, "ic2-mod")) Integration.addModule(new ModuleIC2());
	if (checkConfig(config, "ic2-api")) Integration.addModule(new ModuleIC2Api());

	if (checkConfig(config, "railcraft-mod")) Integration.addModule(new ModuleRailcraft());
	if (checkConfig(config, "railcraft-api-carts")) Integration.addModule(new ModuleRailcraftCarts());
	if (checkConfig(config, "railcraft-api-fuel")) Integration.addModule(new ModuleRailcraftFuel());

	if (checkConfig(config, "thaumcraft-mod")) Integration.addModule(new ModuleThaumcraft());
	if (checkConfig(config, "thaumcraft-api")) Integration.addModule(new ModuleThaumcraftApi());

	if (checkConfig(config, "mfr-mod")) Integration.addModule(new ModuleMinefactoryReloaded());
	if (checkConfig(config, "mfr-mod-storage")) Integration.addModule(new ModuleMinefactoryReloadedStorage());

	if (checkConfig(config, "computercraft-mod")) Integration.addModule(new ModuleComputerCraft());
	if (checkConfig(config, "enderstorage-mod")) Integration.addModule(new ModuleEnderStorage());
	if (checkConfig(config, "forestry-mod")) Integration.addModule(new ModuleForestry());
	if (checkConfig(config, "mystcraft-mod")) {
		if (sameOrNewerVersion(Mods.MYSTCRAFT, "0.11.1.00")) {
			if (sameOrNewerVersion(Mods.MYSTCRAFT, "0.11.6.02")) {
				FMLInterModComms.sendMessage(Mods.MYSTCRAFT, "API", "openperipheral.integration.mystcraft.v2.MystcraftAccess.init");
				Integration.addModule(new ModuleMystcraftV2());
			} else {
				Log.warn("Unsupported Mystcraft version!");
			}
		} else {
			Log.warn("Using old Mystcraft integration, things may explode");
			Integration.addModule(new ModuleMystcraftV1());
		}
	}
	if (checkConfig(config, "thaumcraft-mod")) Integration.addModule(new ModuleThaumcraft());
	if (checkConfig(config, "tmechworks-mod")) Integration.addModule(new ModuleTMechworks());
	if (checkConfig(config, "thermalexpansion-mod")) Integration.addModule(new ModuleThermalExpansion());
	if (checkConfig(config, "ae2-mod")) Integration.addModule(new ModuleAppEng());

	ConfigProcessing.processAnnotations(MOD_ID, config, Config.class);

	FMLCommonHandler.instance().bus().register(new ConfigChangeListener(MOD_ID, config));

	if (config.hasChanged()) config.save();
}