Java Code Examples for cpw.mods.fml.common.event.FMLInterModComms

The following are top voted examples for showing how to use cpw.mods.fml.common.event.FMLInterModComms. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: RorysMod   File: ClientProxy.java   View source code 7 votes vote down vote up
@Override
public void init(FMLInitializationEvent e) {
	super.init(e);
	Register.registerGlobalEntityID(EntityLaser.class, "laser");

	Register.registerEntityRenderingHandler(EntityLaser.class, new RenderLaser());

	Register.registerItemRenderer(RorysMod.items.rifle1, new RenderRifle());
	Register.registerItemRenderer(RorysMod.items.rifle2, new RenderRifle());
	Register.registerItemRenderer(RorysMod.items.rifle3, new RenderRifle());
	Register.registerItemRenderer(RorysMod.items.rifle4, new RenderRifle());
	Register.registerItemRenderer(RorysMod.items.rifle5, new RenderRifle());

	TileEntitySpecialRenderer render = new RenderRifleTable();
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRifleTable.class, render);
	Register.registerItemRenderer(Item.getItemFromBlock(RorysMod.blocks.upgradeTable), new ItemRender(render, new TileEntityRifleTable()));

	render = new RenderPoweredChest();
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPoweredChest.class, render);

	FMLInterModComms.sendMessage("Waila", "register", WailaConfig.class.getName() + ".callbackRegister");
}
 
Example 2
Project: ExtraUtilities   File: TE4IMC.java   View source code 6 votes vote down vote up
public static void addSmelter(int energy, final ItemStack a, final ItemStack b, final ItemStack output, final ItemStack altOutput, final int prob) {
    if (a == null || b == null || output == null) {
        return;
    }
    if (energy <= 0) {
        energy = 4000;
    }
    final NBTTagCompound tag = new NBTTagCompound();
    tag.setInteger("energy", energy);
    tag.setTag("primaryInput", (NBTBase)getItemStackNBT(a));
    tag.setTag("secondaryInput", (NBTBase)getItemStackNBT(b));
    tag.setTag("primaryOutput", (NBTBase)getItemStackNBT(output));
    if (altOutput != null) {
        tag.setTag("secondaryOutput", (NBTBase)getItemStackNBT(altOutput));
        tag.setInteger("secondaryChance", prob);
    }
    FMLInterModComms.sendMessage("ThermalExpansion", "SmelterRecipe", tag);
}
 
Example 3
Project: TRHS_Club_Mod_2016   File: Loader.java   View source code 6 votes vote down vote up
public void initializeMods()
{
    progressBar.step("Initializing mods Phase 2");
    // Mod controller should be in the initialization state here
    modController.distributeStateMessage(LoaderState.INITIALIZATION);
    progressBar.step("Initializing mods Phase 3");
    modController.transition(LoaderState.POSTINITIALIZATION, false);
    modController.distributeStateMessage(FMLInterModComms.IMCEvent.class);
    ItemStackHolderInjector.INSTANCE.inject();
    modController.distributeStateMessage(LoaderState.POSTINITIALIZATION);
    progressBar.step("Finishing up");
    modController.transition(LoaderState.AVAILABLE, false);
    modController.distributeStateMessage(LoaderState.AVAILABLE);
    GameData.freezeData();
    // Dump the custom registry data map, if necessary
    GameData.dumpRegistry(minecraftDir);
    FMLLog.info("Forge Mod Loader has successfully loaded %d mod%s", mods.size(), mods.size() == 1 ? "" : "s");
    progressBar.step("Completing Minecraft initialization");
}
 
Example 4
Project: RorysMod   File: Register.java   View source code 6 votes vote down vote up
public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {
	if (input == null || primaryOutput == null) {
		return;
	}
	NBTTagCompound toSend = new NBTTagCompound();
	toSend.setInteger("energy", energy);
	toSend.setTag("input", new NBTTagCompound());
	toSend.setTag("primaryOutput", new NBTTagCompound());
	if (secondaryOutput != null) {
		toSend.setTag("secondaryOutput", new NBTTagCompound());
	}
	input.writeToNBT(toSend.getCompoundTag("input"));
	primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));
	if (secondaryOutput != null) {
		secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
		toSend.setInteger("secondaryChance", secondaryChance);
	}
	boolean bool = FMLInterModComms.sendMessage("ThermalExpansion", "PulverizerRecipe", toSend);
	if (bool) recipies++;
}
 
Example 5
Project: RorysMod   File: Register.java   View source code 6 votes vote down vote up
public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {
	NBTTagCompound data = new NBTTagCompound();
	data.setInteger("energy", energy);
	NBTTagCompound input1Compound = new NBTTagCompound();
	primaryInput.writeToNBT(input1Compound);
	data.setTag("primaryInput", input1Compound);

	NBTTagCompound input2Compound = new NBTTagCompound();
	secondaryInput.writeToNBT(input2Compound);
	data.setTag("secondaryInput", input2Compound);

	NBTTagCompound output1Compound = new NBTTagCompound();
	primaryOutput.writeToNBT(output1Compound);
	data.setTag("primaryOutput", output1Compound);

	if (secondaryOutput != null) {
		NBTTagCompound output2Compound = new NBTTagCompound();
		secondaryOutput.writeToNBT(output2Compound);
		data.setTag("secondaryOutput", output2Compound);

		data.setInteger("secondaryChance", secondaryChance);
	}
	boolean bool = FMLInterModComms.sendMessage("ThermalExpansion", "SmelterRecipe", data);
	if (bool) recipies++;
}
 
Example 6
Project: MagicBees   File: Config.java   View source code 6 votes vote down vote up
private void setupThaumcraftBackpacks() {
	try {
		// 0x8700C6 is a purple-y colour, which is associated with Thaumcraft.
		String backpackName = LocalizationManager.getLocalizedString("backpack.thaumaturge");
		BackpackDefinition def = new BackpackDefinition("thaumaturge", backpackName, 0x8700C6);
		thaumaturgeBackpackT1 = BackpackManager.backpackInterface.addBackpack(def, EnumBackpackType.T1);
		thaumaturgeBackpackT1.setUnlocalizedName("backpack.thaumaturgeT1");
		GameRegistry.registerItem(thaumaturgeBackpackT1, "backpack.thaumaturgeT1");
		thaumaturgeBackpackT2 = BackpackManager.backpackInterface.addBackpack(def, EnumBackpackType.T2);
		thaumaturgeBackpackT2.setUnlocalizedName("backpack.thaumaturgeT2");
		GameRegistry.registerItem(thaumaturgeBackpackT2, "backpack.thaumaturgeT2");
		// Add additional items from configs to backpack.
		if (thaumaturgeExtraItems.length() > 0) {
			LogHelper.info("Attempting to add extra items to Thaumaturge's backpack. If you get an error, check your MagicBees.conf.");
			FMLInterModComms.sendMessage("Forestry", "add-backpack-items", "[email protected]" + thaumaturgeExtraItems);
		}
	}
	catch (Exception e) {
		LogHelper.error("MagicBees encountered a problem during loading!");
		LogHelper.error("Could not register backpacks via Forestry. Check your FML Client log and see if Forestry crashed silently.");
	}
}
 
Example 7
Project: NewHorizonsCoreMod   File: GT_CustomLoader.java   View source code 6 votes vote down vote up
private void fixEnderIO(){
    //Example of how to add a recipe:

    NBTTagCompound root = new NBTTagCompound();
    root.setString(SoulBinderRecipeManager.KEY_RECIPE_UID, "sentientEnderMK2");
    root.setInteger(SoulBinderRecipeManager.KEY_REQUIRED_ENERGY, 100000);
    root.setInteger(SoulBinderRecipeManager.KEY_REQUIRED_XP, 10);
    root.setString(SoulBinderRecipeManager.KEY_SOUL_TYPES, "SpecialMobs.SpecialWitch");
    ItemStack is = new ItemStack(EnderIO.itemFrankenSkull, 1, FrankenSkull.ENDER_RESONATOR.ordinal());
    NBTTagCompound stackRoot = new NBTTagCompound();
    is.writeToNBT(stackRoot);
    root.setTag(SoulBinderRecipeManager.KEY_INPUT_STACK, stackRoot);
    is = new ItemStack(EnderIO.itemFrankenSkull, 1, FrankenSkull.SENTIENT_ENDER.ordinal());
    stackRoot = new NBTTagCompound();
    is.writeToNBT(stackRoot);
    root.setTag(SoulBinderRecipeManager.KEY_OUTPUT_STACK, stackRoot);

    SoulBinderRecipeManager.getInstance().addRecipeFromNBT(root);
    FMLInterModComms.sendMessage("EnderIO",  "recipe:soulbinder", root);

}
 
Example 8
Project: ModpackInfo   File: VersionCheck.java   View source code 6 votes vote down vote up
public static void register() {

		if (Loader.isModLoaded("VersionChecker")) {
			final NBTTagCompound nbt = new NBTTagCompound();
			nbt.setString("curseProjectName", CURSE_PROJECT_NAME);
			nbt.setString("curseFilenameParser", MOD_NAME_TEMPLATE);
			FMLInterModComms.sendRuntimeMessage(ModpackInfo.MOD_ID,
					"VersionChecker", "addVersionCheck", nbt);
		}

		if (ModOptions.getOnlineVersionChecking()) {
			final VersionCheck test = new VersionCheck();
			FMLCommonHandler.instance().bus().register(test);
			new Thread(test).start();
		}
	}
 
Example 9
Project: Augury   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {

		if (input == null || primaryOutput == null) {
			return;
		}
		NBTTagCompound toSend = new NBTTagCompound();

		toSend.setInteger("energy", energy);
		toSend.setTag("input", new NBTTagCompound());
		toSend.setTag("primaryOutput", new NBTTagCompound());

		if (secondaryOutput != null) {
			toSend.setTag("secondaryOutput", new NBTTagCompound());
		}

		input.writeToNBT(toSend.getCompoundTag("input"));
		primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));

		if (secondaryOutput != null) {
			secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
			toSend.setInteger("secondaryChance", secondaryChance);
		}

		FMLInterModComms.sendMessage("ThermalExpansion", "PulverizerRecipe", toSend);
	}
 
Example 10
Project: Augury   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {

		if (input == null || primaryOutput == null) {
			return;
		}
		NBTTagCompound toSend = new NBTTagCompound();

		toSend.setInteger("energy", energy);
		toSend.setTag("input", new NBTTagCompound());
		toSend.setTag("primaryOutput", new NBTTagCompound());

		if (secondaryOutput != null) {
			toSend.setTag("secondaryOutput", new NBTTagCompound());
		}

		input.writeToNBT(toSend.getCompoundTag("input"));
		primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));

		if (secondaryOutput != null) {
			secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
			toSend.setInteger("secondaryChance", secondaryChance);
		}

		FMLInterModComms.sendMessage("ThermalExpansion", "SawmillRecipe", toSend);
	}
 
Example 11
Project: Augury   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addCrucibleRecipe(int energy, ItemStack input, FluidStack output) {

		if (input == null || output == null) {
			return;
		}
		NBTTagCompound toSend = new NBTTagCompound();

		toSend.setInteger("energy", energy);
		toSend.setTag("input", new NBTTagCompound());
		toSend.setTag("output", new NBTTagCompound());

		input.writeToNBT(toSend.getCompoundTag("input"));
		output.writeToNBT(toSend.getCompoundTag("output"));

		FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend);
	}
 
Example 12
Project: Augury   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addTransposerFill(int energy, ItemStack input, ItemStack output, FluidStack fluid, boolean reversible) {

		if (input == null || output == null || fluid == null) {
			return;
		}
		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 13
Project: Augury   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addTransposerExtract(int energy, ItemStack input, ItemStack output, FluidStack fluid, int chance, boolean reversible) {

		if (input == null || output == null || fluid == null) {
			return;
		}
		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);
		toSend.setInteger("chance", chance);
		fluid.writeToNBT(toSend.getCompoundTag("fluid"));

		FMLInterModComms.sendMessage("ThermalExpansion", "TransposerExtractRecipe", toSend);
	}
 
Example 14
Project: RFDrills   File: EnderIOCompat.java   View source code 6 votes vote down vote up
public static void addAlloySmelterRecipe(String name, int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack tertiaryInput, ItemStack output) {
    StringBuilder toSend = new StringBuilder();

    toSend.append("<recipeGroup name=\"" + Reference.MOD_ID + "\">");
        toSend.append("<recipe name=\"" + name + "\" energyCost=\"" + energy + "\">");
            toSend.append("<input>");
                writeItemStack(toSend, primaryInput);
                writeItemStack(toSend, secondaryInput);
                writeItemStack(toSend, tertiaryInput);
            toSend.append("</input>");
            toSend.append("<output>");
                writeItemStack(toSend, output);
            toSend.append("</output>");
        toSend.append("</recipe>");
    toSend.append("</recipeGroup>");

    FMLInterModComms.sendMessage("EnderIO", "recipe:alloysmelter", toSend.toString());
}
 
Example 15
Project: ToggleBlocks   File: ToggleBlocks.java   View source code 6 votes vote down vote up
@Mod.EventHandler
public static void init(FMLInitializationEvent event)
{
    if (Loader.isModLoaded("NotEnoughItems"))
    {
        try
        {
            System.out.println("Registering NEI comp.");
            codechicken.nei.NEIModContainer.plugins.add(new NEIToggleConfig());
        } catch (Exception ignored)
        {
        }
    }

    MinecraftForge.EVENT_BUS.register(new EventHandler());
    proxy.registerRenderer();
    FMLInterModComms.sendRuntimeMessage(ModInfo.MOD_ID, "VersionChecker", "addVersionCheck", "http://mrspring.dk/mods/tb/versions.json");
    FMLInterModComms.sendMessage("tb", "register", "dk.mrspring.toggle.comp.vanilla.ToggleRegistryCallback.register");
    FMLInterModComms.sendMessage("Waila", "register", "dk.mrspring.toggle.comp.waila.WailaCompatibility.callbackRegister");
    Recipes.register();
}
 
Example 16
Project: vsminecraft   File: MultipartMekanism.java   View source code 6 votes vote down vote up
public void registerMicroMaterials()
{
	for(int i = 0; i < 16; i++)
	{
		MicroMaterialRegistry.registerMaterial(new PlasticMicroMaterial(MekanismBlocks.PlasticBlock, i), BlockMicroMaterial.materialKey(MekanismBlocks.PlasticBlock, i));
		MicroMaterialRegistry.registerMaterial(new PlasticMicroMaterial(MekanismBlocks.GlowPlasticBlock, i), BlockMicroMaterial.materialKey(MekanismBlocks.GlowPlasticBlock, i));
		MicroMaterialRegistry.registerMaterial(new PlasticMicroMaterial(MekanismBlocks.SlickPlasticBlock, i), BlockMicroMaterial.materialKey(MekanismBlocks.SlickPlasticBlock, i));
		MicroMaterialRegistry.registerMaterial(new PlasticMicroMaterial(MekanismBlocks.ReinforcedPlasticBlock, i), BlockMicroMaterial.materialKey(MekanismBlocks.ReinforcedPlasticBlock, i));
		MicroMaterialRegistry.registerMaterial(new PlasticMicroMaterial(MekanismBlocks.RoadPlasticBlock, i), BlockMicroMaterial.materialKey(MekanismBlocks.RoadPlasticBlock, i));

		FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(MekanismBlocks.BasicBlock, 1, i));
		
		if(!MachineType.get(MACHINE_BLOCK_1, i).hasModel)
		{
			FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(MekanismBlocks.MachineBlock, 1, i));
		}
		
		if(!MachineType.get(MACHINE_BLOCK_2, i).hasModel)
		{
			FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(MekanismBlocks.MachineBlock2, 1, i));
		}
	}
	
	FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(MekanismBlocks.BasicBlock2, 1, 0));
	FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(MekanismBlocks.CardboardBox));
}
 
Example 17
Project: PlayerInterfaceMod   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
/**
    * MACHINES
    */

/* Furnace */
   public static void addFurnaceRecipe(int energy, ItemStack input, ItemStack output) {

       if (input == null || output == null) {
           return;
       }
       NBTTagCompound toSend = new NBTTagCompound();

       toSend.setInteger("energy", energy);
       toSend.setTag("input", new NBTTagCompound());
       toSend.setTag("output", new NBTTagCompound());

       input.writeToNBT(toSend.getCompoundTag("input"));
       output.writeToNBT(toSend.getCompoundTag("output"));
       FMLInterModComms.sendMessage("ThermalExpansion", "FurnaceRecipe", toSend);
   }
 
Example 18
Project: PlayerInterfaceMod   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {

        if (input == null || primaryOutput == null) {
            return;
        }
        NBTTagCompound toSend = new NBTTagCompound();

        toSend.setInteger("energy", energy);
        toSend.setTag("input", new NBTTagCompound());
        toSend.setTag("primaryOutput", new NBTTagCompound());

        if (secondaryOutput != null) {
            toSend.setTag("secondaryOutput", new NBTTagCompound());
        }

        input.writeToNBT(toSend.getCompoundTag("input"));
        primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));

        if (secondaryOutput != null) {
            secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
            toSend.setInteger("secondaryChance", secondaryChance);
        }

        FMLInterModComms.sendMessage("ThermalExpansion", "PulverizerRecipe", toSend);
    }
 
Example 19
Project: PlayerInterfaceMod   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {

        if (input == null || primaryOutput == null) {
            return;
        }
        NBTTagCompound toSend = new NBTTagCompound();

        toSend.setInteger("energy", energy);
        toSend.setTag("input", new NBTTagCompound());
        toSend.setTag("primaryOutput", new NBTTagCompound());

        if (secondaryOutput != null) {
            toSend.setTag("secondaryOutput", new NBTTagCompound());
        }

        input.writeToNBT(toSend.getCompoundTag("input"));
        primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));

        if (secondaryOutput != null) {
            secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
            toSend.setInteger("secondaryChance", secondaryChance);
        }

        FMLInterModComms.sendMessage("ThermalExpansion", "SawmillRecipe", toSend);
    }
 
Example 20
Project: PlayerInterfaceMod   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addCrucibleRecipe(int energy, ItemStack input, FluidStack output) {

        if (input == null || output == null) {
            return;
        }
        NBTTagCompound toSend = new NBTTagCompound();

        toSend.setInteger("energy", energy);
        toSend.setTag("input", new NBTTagCompound());
        toSend.setTag("output", new NBTTagCompound());

        input.writeToNBT(toSend.getCompoundTag("input"));
        output.writeToNBT(toSend.getCompoundTag("output"));

        FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend);
    }
 
Example 21
Project: PlayerInterfaceMod   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addTransposerFill(int energy, ItemStack input, ItemStack output, FluidStack fluid, boolean reversible) {

        if (input == null || output == null || fluid == null) {
            return;
        }
        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 22
Project: PlayerInterfaceMod   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addTransposerExtract(int energy, ItemStack input, ItemStack output, FluidStack fluid, int chance, boolean reversible) {

        if (input == null || output == null || fluid == null) {
            return;
        }
        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);
        toSend.setInteger("chance", chance);
        fluid.writeToNBT(toSend.getCompoundTag("fluid"));

        FMLInterModComms.sendMessage("ThermalExpansion", "TransposerExtractRecipe", toSend);
    }
 
Example 23
Project: WIIEMC   File: VersionChecker.java   View source code 6 votes vote down vote up
private void sendMessage() {
    if (Loader.isModLoaded("VersionChecker")) {
        String changeLog = "";
        for (String i : this.changeList)
            changeLog += "- " + i;

        NBTTagCompound tag = new NBTTagCompound();
        tag.setString("modDisplayName", this.modname);
        tag.setString("oldVersion", this.currentVer);
        tag.setString("newVersion", this.version);
        tag.setString("updateUrl", this.downloadURL);
        tag.setBoolean("isDirectLink", this.isDirect);
        tag.setString("changeLog", changeLog);
        FMLInterModComms.sendMessage("VersionChecker", "addUpdate", tag);
    }
    Logger.logInfo(String.format(translate("update.wiiemc"), this.version, this.downloadURL));
}
 
Example 24
Project: WIIEMC   File: Proxy.java   View source code 6 votes vote down vote up
public void init() {
    WIIEMC.config.initEvent();

    Logger.logInfo("Beware the flower pots...they will confuse you and ambush you...");
    if (Loader.isModLoaded("EE3")) {
        FMLInterModComms.sendMessage("Waila", "register", "net.lomeli.wiiemc.providers.ee3.BlockEMCDataProvider.callbackRegister");
        FMLInterModComms.sendMessage("Waila", "register", "net.lomeli.wiiemc.providers.ee3.EntityEMCDataProvider.callbackRegister");
        FMLInterModComms.sendMessage("Waila", "register", "net.lomeli.wiiemc.providers.ee3.TileEMCDataProvider.callbackRegister");
        MinecraftForge.EVENT_BUS.register(new EventHandler());
    }
    if (Loader.isModLoaded("ProjectE")) {
        FMLInterModComms.sendMessage("Waila", "register", "net.lomeli.wiiemc.providers.projecte.BlockEMCDataProvider.callbackRegister");
        FMLInterModComms.sendMessage("Waila", "register", "net.lomeli.wiiemc.providers.projecte.EntityEMCDataProvider.callbackRegister");
        FMLInterModComms.sendMessage("Waila", "register", "net.lomeli.wiiemc.providers.projecte.TileEMCDataProvider.callbackRegister");
    }
    if (Loader.isModLoaded("simplecondenser"))
        Logger.logInfo("Aww...I feel all special now...");

    if (Loader.isModLoaded("EE3") && Loader.isModLoaded("ProjectE"))
        Logger.logError("Greedy little fella, aren't ya?");
}
 
Example 25
Project: AMCore   File: AMCore.java   View source code 6 votes vote down vote up
@EventHandler
public void handleIMC(FMLInterModComms.IMCEvent event) {

    // IMCHandler
    try {
        log.info("Processing IMC messages...");
        IMCHandler.processIMC(event.getMessages());
        log.info("IMC Messages processed.");
    } catch (Exception e) {
        log.error("=============================ERROR!=============================");
        log.error("Failed to process IMC Messages, printing stacktrace...");
        log.error("Please report this as a bug report with the stacktrace, the minecraft log and a mod list + version to: " + issueURL);
        log.error("=============================ERROR!=============================");
        e.printStackTrace();
    }
}
 
Example 26
Project: AMCore   File: AMCore.java   View source code 6 votes vote down vote up
@EventHandler
public void loadComplete(FMLLoadCompleteEvent event) {

    // Fetching runtime messages
    try {
        log.info("Fetching runtime IMC messages...");
        IMCHandler.processIMC(FMLInterModComms.fetchRuntimeMessages(this));
        log.info("Fetched runtime IMC messages.");
    } catch (Exception e) {
        log.error("=============================ERROR!=============================");
        log.error("Failed to fetch IMC Runtime messages, printing stacktrace...");
        log.error("Please report this as a bug report with the stacktrace, the minecraft log and a mod list + version to: " + issueURL);
        log.error("=============================ERROR!=============================");
        e.printStackTrace();
    }
}
 
Example 27
Project: R0b0ts   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {

		NBTTagCompound toSend = new NBTTagCompound();

		toSend.setInteger("energy", energy);
		toSend.setCompoundTag("input", new NBTTagCompound());
		toSend.setCompoundTag("primaryOutput", new NBTTagCompound());
		toSend.setCompoundTag("secondaryOutput", new NBTTagCompound());

		input.writeToNBT(toSend.getCompoundTag("input"));
		primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));
		secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
		toSend.setInteger("secondaryChance", secondaryChance);

		FMLInterModComms.sendMessage("ThermalExpansion", "PulverizerRecipe", toSend);
	}
 
Example 28
Project: Fluxed-Trinkets   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {

		if (input == null || primaryOutput == null) {
			return;
		}
		NBTTagCompound toSend = new NBTTagCompound();

		toSend.setInteger("energy", energy);
		toSend.setTag("input", new NBTTagCompound());
		toSend.setTag("primaryOutput", new NBTTagCompound());

		if (secondaryOutput != null) {
			toSend.setTag("secondaryOutput", new NBTTagCompound());
		}

		input.writeToNBT(toSend.getCompoundTag("input"));
		primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));

		if (secondaryOutput != null) {
			secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
			toSend.setInteger("secondaryChance", secondaryChance);
		}

		FMLInterModComms.sendMessage("ThermalExpansion", "SawmillRecipe", toSend);
	}
 
Example 29
Project: R0b0ts   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addTransposerExtract(int energy, ItemStack input, ItemStack output, FluidStack fluid, int chance, boolean reversible) {

		NBTTagCompound toSend = new NBTTagCompound();

		toSend.setInteger("energy", energy);
		toSend.setCompoundTag("input", new NBTTagCompound());
		toSend.setCompoundTag("output", new NBTTagCompound());
		toSend.setCompoundTag("fluid", new NBTTagCompound());

		input.writeToNBT(toSend.getCompoundTag("input"));
		output.writeToNBT(toSend.getCompoundTag("output"));
		toSend.setBoolean("reversible", reversible);
		toSend.setInteger("chance", chance);
		fluid.writeToNBT(toSend.getCompoundTag("fluid"));

		FMLInterModComms.sendMessage("ThermalExpansion", "TransposerExtractRecipe", toSend);
	}
 
Example 30
Project: CartLivery   File: ModCartLivery.java   View source code 6 votes vote down vote up
@Mod.EventHandler
public void handleIMCMessage(FMLInterModComms.IMCEvent event) {
	for (IMCMessage message : event.getMessages()) {
		if ("addClassExclusion".equals(message.key) && message.isStringMessage()) {
			try {
				Class<?> clazz = Class.forName(message.getStringValue());
				CommonProxy.excludedClasses.add(clazz);
			} catch (ClassNotFoundException e) {
				I18n.format("message.cartlivery.invalidExclusion", message.getSender(), message.getStringValue());
			}
		}
		if ("addBuiltInLiveries".equals(message.key) && message.isStringMessage() && FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
			String[] liveries = message.getStringValue().split(",");
			log.info(I18n.format("message.cartlivery.registerBuiltIn", liveries.length, message.getSender()));
			for(String livery : liveries) LiveryTextureRegistry.builtInLiveries.put(livery, message.getSender());
		}
	}
}
 
Example 31
Project: PeripheralsPlusPlus   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {

		if (input == null || primaryOutput == null) {
			return;
		}
		NBTTagCompound toSend = new NBTTagCompound();

		toSend.setInteger("energy", energy);
		toSend.setTag("input", new NBTTagCompound());
		toSend.setTag("primaryOutput", new NBTTagCompound());

		if (secondaryOutput != null) {
			toSend.setTag("secondaryOutput", new NBTTagCompound());
		}

		input.writeToNBT(toSend.getCompoundTag("input"));
		primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));

		if (secondaryOutput != null) {
			secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
			toSend.setInteger("secondaryChance", secondaryChance);
		}

		FMLInterModComms.sendMessage("ThermalExpansion", "PulverizerRecipe", toSend);
	}
 
Example 32
Project: A-Cup-of-Java   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addTransposerExtract(int energy, ItemStack input, ItemStack output, FluidStack fluid, int chance, boolean reversible)
{

    if (input == null || output == null || fluid == null)
    {
        return;
    }
    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);
    toSend.setInteger("chance", chance);
    fluid.writeToNBT(toSend.getCompoundTag("fluid"));

    FMLInterModComms.sendMessage("ThermalExpansion", "TransposerExtractRecipe", toSend);
}
 
Example 33
Project: IceAndShadow2   File: IceAndShadow2.java   View source code 6 votes vote down vote up
@EventHandler
public void init2(FMLInitializationEvent event) {
	NyxRecipes.init();

	if (IaSFlags.flag_death_system) {
		MinecraftForge.EVENT_BUS.register(new NyxDeathSystem());
	}

	NyxBiomes.registerBiomes();
	MinecraftForge.EVENT_BUS.register(new IaSTooltipHandler());
	MinecraftForge.EVENT_BUS.register(new NyxEventHandlerCold());
	MinecraftForge.EVENT_BUS.register(new NyxBlockHandler());
	MinecraftForge.EVENT_BUS.register(new NyxEquipmentHandler());
	GameRegistry.registerFuelHandler(new NyxFuelHandler());

	// Be nice, Thaumcraft.
	FMLInterModComms.sendMessage("Thaumcraft", "dimensionBlacklist", "" + IaSFlags.dim_nyx_id + ":0");
}
 
Example 34
Project: PeripheralsPlusPlus   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addTransposerFill(int energy, ItemStack input, ItemStack output, FluidStack fluid, boolean reversible) {

		if (input == null || output == null || fluid == null) {
			return;
		}
		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 35
Project: PeripheralsPlusPlus   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addTransposerExtract(int energy, ItemStack input, ItemStack output, FluidStack fluid, int chance, boolean reversible) {

		if (input == null || output == null || fluid == null) {
			return;
		}
		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);
		toSend.setInteger("chance", chance);
		fluid.writeToNBT(toSend.getCompoundTag("fluid"));

		FMLInterModComms.sendMessage("ThermalExpansion", "TransposerExtractRecipe", toSend);
	}
 
Example 36
Project: OresPlus   File: MekanismHelper.java   View source code 6 votes vote down vote up
private void sendSimpleImcRecipe(String recipeKey, ItemStack input, Gas gasType, ItemStack output) {
	NBTTagCompound msg = new NBTTagCompound();
	
	NBTTagCompound nbtInput = new NBTTagCompound();
	input.writeToNBT(nbtInput);
	msg.setTag("input", nbtInput);
	
	if (gasType != null) {
		NBTTagCompound nbtGasType = new NBTTagCompound();
		gasType.write(nbtGasType);
		msg.setTag("gasType", nbtGasType);
	}
	
	NBTTagCompound nbtOutput = new NBTTagCompound();
	output.writeToNBT(nbtOutput);
	msg.setTag("output", nbtOutput);
	
	FMLInterModComms.sendMessage(this._modID, recipeKey, msg);
}
 
Example 37
Project: R0b0ts   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput, ItemStack secondaryOutput,
		int secondaryChance) {

	NBTTagCompound toSend = new NBTTagCompound();

	toSend.setInteger("energy", energy);
	toSend.setCompoundTag("primaryInput", new NBTTagCompound());
	toSend.setCompoundTag("secondaryInput", new NBTTagCompound());
	toSend.setCompoundTag("primaryOutput", new NBTTagCompound());
	toSend.setCompoundTag("secondaryOutput", new NBTTagCompound());

	primaryInput.writeToNBT(toSend.getCompoundTag("primaryInput"));
	secondaryInput.writeToNBT(toSend.getCompoundTag("secondaryInput"));
	primaryOutput.writeToNBT(toSend.getCompoundTag("primaryOutput"));
	secondaryOutput.writeToNBT(toSend.getCompoundTag("secondaryOutput"));
	toSend.setInteger("secondaryChance", secondaryChance);

	FMLInterModComms.sendMessage("ThermalExpansion", "SmelterRecipe", toSend);
}
 
Example 38
Project: A-Cup-of-Java   File: ThermalExpansionHelper.java   View source code 6 votes vote down vote up
public static void addTransposerFill(int energy, ItemStack input, ItemStack output, FluidStack fluid, boolean reversible)
{

    if (input == null || output == null || fluid == null)
    {
        return;
    }
    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 39
Project: Chisel-2   File: Chisel.java   View source code 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 40
Project: SecurityCraft   File: SecurityCraft.java   View source code 6 votes vote down vote up
@EventHandler
public void init(FMLInitializationEvent event){
	log("Setting up inter-mod stuff...");

	FMLInterModComms.sendMessage("Waila", "register", "net.geforcemods.securitycraft.imc.waila.WailaDataProvider.callbackRegister");
	FMLInterModComms.sendMessage("LookingGlass", "API", "net.geforcemods.securitycraft.imc.lookingglass.LookingGlassAPIProvider.register");

	if(config.checkForUpdates) {
		NBTTagCompound vcUpdateTag = VersionUpdateChecker.getNBTTagCompound();
		if(vcUpdateTag != null)
			FMLInterModComms.sendRuntimeMessage(MODID, "VersionChecker", "addUpdate", vcUpdateTag);
	}

	log("Registering mod content... (PT 2/2)");
	NetworkRegistry.INSTANCE.registerGuiHandler(this, guiHandler);
	RegistrationHandler.registerEntities();
	EnumCustomModules.refresh();
	serverProxy.registerRenderThings();
}