IMC or Inter Mod Comms

are small messages sent between mods during start up or run-time that allow modders to add or trigger code in another mod without requiring to interact with the API of that mod directly, below are a list of the various IMC's that AE2 will accept.

 

Spatial Tile Entity Movement

If you want to allow AE2 to move your tiles simply send the full class name via this IMC and AE will white-list it, this works well if your tile entity is simple, like a chest, more complicated tile entities and multiblocks maybe fail or crash if you use this approach, if you wish to add support for them, you may wish to use the full API if you need more intricate control.

FMLInterModComms.sendMessage( "appliedenergistics2", "whitelist-spatial", "mymod.tileentities.MyTileEntity" );

 

P2P Item Attunement

Allows you to add new ways to attune p2p tunnels with other items.

FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-me", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-bc-power", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-ic2-power", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-redstone", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-fluid", new ItemStack( myBlockOrItem ) );
FMLInterModComms.sendMessage( "appliedenergistics2", "add-p2p-attunement-item", new ItemStack( myBlockOrItem ) );

 

Matter Cannon Ammo

Allows you to send new ammo for the matter cannon, weight for most materials already used is based on the atomic number ( food and other renewable resources are 32 )

NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound item = new NBTTagCompound();

new ItemStack( Blocks.anvil ).writeToNBT( item );
msg.setTag( "item", item );
msg.setDouble( "weight", 32.0 );

FMLInterModComms.sendMessage( "appliedenergistics2", "add-mattercannon-ammo", msg );

 

Grindable Ores

AE2 features a auto detection system and white-list for ores by default, but some materials are not picked up by this automatically so you may want to add them manually. This has two versions, one with a fixed input and output, and one with a optional random item.

NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound in = new NBTTagCompound();
NBTTagCompound out = new NBTTagCompound();

new ItemStack( Blocks.iron_ore ).writeToNBT( in );
new ItemStack( Items.iron_ingot ).writeToNBT( out );
msg.setTag( "in", in );
msg.setTag( "out", out );
msg.setInteger( "turns", 8 );

FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg );

-- or --

NBTTagCompound msg = new NBTTagCompound();
NBTTagCompound in = new NBTTagCompound();
NBTTagCompound out = new NBTTagCompound();
NBTTagCompound optional = new NBTTagCompound();

new ItemStack( Blocks.iron_ore ).writeToNBT( in );
new ItemStack( Items.iron_ingot ).writeToNBT( out );
new ItemStack( Blocks.gravel ).writeToNBT( optional );
msg.setTag( "in", in );
msg.setTag( "out", out );
msg.setTag( "optional", optional );
msg.setFloat( "chance", 0.5 );
msg.setInteger( "turns", 8 );

FMLInterModComms.sendMessage( "appliedenergistics2", "add-grindable", msg );

Last modified on 09/15/2014 02:41 PM CDT
By thatsIch