本文整理汇总了Java中cpw.mods.fml.common.event.FMLInterModComms类的典型用法代码示例。如果您正苦于以下问题:Java FMLInterModComms类的具体用法?Java FMLInterModComms怎么用?Java FMLInterModComms使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FMLInterModComms类属于cpw.mods.fml.common.event包,在下文中一共展示了FMLInterModComms类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import cpw.mods.fml.common.event.FMLInterModComms; //导入依赖的package包/类
@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");
}
示例2: addSmelter
import cpw.mods.fml.common.event.FMLInterModComms; //导入依赖的package包/类
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);
}
示例3: initializeMods
import cpw.mods.fml.common.event.FMLInterModComms; //导入依赖的package包/类
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");
}
示例4: addPulverizerRecipe
import cpw.mods.fml.common.event.FMLInterModComms; //导入依赖的package包/类
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++;
}
示例5: addSmelterRecipe
import cpw.mods.fml.common.event.FMLInterModComms; //导入依赖的package包/类
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++;
}
示例6: setupThaumcraftBackpacks
import cpw.mods.fml.common.event.FMLInterModComms; //导入依赖的package包/类
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.");
}
}
示例7: fixEnderIO
import cpw.mods.fml.common.event.FMLInterModComms; //导入依赖的package包/类
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);
}
示例8: register
import cpw.mods.fml.common.event.FMLInterModComms; //导入依赖的package包/类
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();
}
}
示例9: addPulverizerRecipe
import cpw.mods.fml.common.event.FMLInterModComms; //导入依赖的package包/类
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);
}
示例10: addSawmillRecipe
import cpw.mods.fml.common.event.FMLInterModComms; //导入依赖的package包/类
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);
}
示例11: addCrucibleRecipe
import cpw.mods.fml.common.event.FMLInterModComms; //导入依赖的package包/类
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);
}
示例12: addTransposerFill
import cpw.mods.fml.common.event.FMLInterModComms; //导入依赖的package包/类
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);
}
示例13: addTransposerExtract
import cpw.mods.fml.common.event.FMLInterModComms; //导入依赖的package包/类
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);
}
示例14: addAlloySmelterRecipe
import cpw.mods.fml.common.event.FMLInterModComms; //导入依赖的package包/类
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());
}
示例15: init
import cpw.mods.fml.common.event.FMLInterModComms; //导入依赖的package包/类
@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();
}