public class FMLInterModComms
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
FMLInterModComms.IMCEvent
Subscribe to this event to receive your messages (they are sent between
FMLInitializationEvent and FMLPostInitializationEvent ) |
static class |
FMLInterModComms.IMCMessage
You will receive an instance of this for each message sent
|
Modifier and Type | Field and Description |
---|---|
private static com.google.common.collect.ImmutableList<FMLInterModComms.IMCMessage> |
emptyIMCList |
private static com.google.common.collect.ArrayListMultimap<java.lang.String,FMLInterModComms.IMCMessage> |
modMessages |
Constructor and Description |
---|
FMLInterModComms() |
Modifier and Type | Method and Description |
---|---|
private static void |
enqueueMessage(java.lang.Object sourceMod,
java.lang.String modTarget,
FMLInterModComms.IMCMessage message) |
private static boolean |
enqueueStartupMessage(java.lang.String modTarget,
FMLInterModComms.IMCMessage message) |
static com.google.common.collect.ImmutableList<FMLInterModComms.IMCMessage> |
fetchRuntimeMessages(java.lang.Object forMod)
Retrieve any pending runtime messages for the mod
|
static boolean |
sendFunctionMessage(java.lang.String modId,
java.lang.String key,
java.lang.String functionClassName)
Send a startup time function message
|
static boolean |
sendMessage(java.lang.String modId,
java.lang.String key,
ItemStack value)
Send a startup time message
|
static boolean |
sendMessage(java.lang.String modId,
java.lang.String key,
NBTTagCompound value)
Send a startup time message
|
static boolean |
sendMessage(java.lang.String modId,
java.lang.String key,
ResourceLocation value)
Send a startup time message
|
static boolean |
sendMessage(java.lang.String modId,
java.lang.String key,
java.lang.String value)
Send a startup time message
|
static void |
sendRuntimeFunctionMessage(java.lang.Object sourceMod,
java.lang.String modId,
java.lang.String key,
java.lang.String functionClassName)
Send a post-startup function message.
|
static void |
sendRuntimeMessage(java.lang.Object sourceMod,
java.lang.String modId,
java.lang.String key,
ItemStack value)
Send a post-startup message
|
static void |
sendRuntimeMessage(java.lang.Object sourceMod,
java.lang.String modId,
java.lang.String key,
NBTTagCompound value)
Send a post-startup message
|
static void |
sendRuntimeMessage(java.lang.Object sourceMod,
java.lang.String modId,
java.lang.String key,
ResourceLocation value)
Send a post-startup message
|
static void |
sendRuntimeMessage(java.lang.Object sourceMod,
java.lang.String modId,
java.lang.String key,
java.lang.String value)
Send a post-startup message
|
private static final com.google.common.collect.ImmutableList<FMLInterModComms.IMCMessage> emptyIMCList
private static com.google.common.collect.ArrayListMultimap<java.lang.String,FMLInterModComms.IMCMessage> modMessages
public static boolean sendMessage(java.lang.String modId, java.lang.String key, NBTTagCompound value)
modId
- The modid to send it tokey
- The mod specific keyvalue
- An NBT type valuepublic static boolean sendMessage(java.lang.String modId, java.lang.String key, ItemStack value)
modId
- The modid to send it tokey
- The mod specific keyvalue
- An Itemstack valuepublic static boolean sendMessage(java.lang.String modId, java.lang.String key, ResourceLocation value)
modId
- The modid to send it tokey
- The mod specific keyvalue
- A ResourceLocation valuepublic static boolean sendMessage(java.lang.String modId, java.lang.String key, java.lang.String value)
modId
- The modid to send it tokey
- The mod specific keyvalue
- A String valuepublic static boolean sendFunctionMessage(java.lang.String modId, java.lang.String key, java.lang.String functionClassName)
modId
- The modid to send it tokey
- The mod specific keyfunctionClassName
- The class name of a function that will be instantiated when the
message is read. It must implement Function
public static void sendRuntimeMessage(java.lang.Object sourceMod, java.lang.String modId, java.lang.String key, NBTTagCompound value)
sourceMod
- The mod sending the messagemodId
- The modid to send it tokey
- The mod specific keyvalue
- An NBT type valuepublic static void sendRuntimeMessage(java.lang.Object sourceMod, java.lang.String modId, java.lang.String key, ItemStack value)
sourceMod
- The mod sending the messagemodId
- The modid to send it tokey
- The mod specific keyvalue
- An Itemstack valuepublic static void sendRuntimeMessage(java.lang.Object sourceMod, java.lang.String modId, java.lang.String key, java.lang.String value)
sourceMod
- The mod sending the messagemodId
- The modid to send it tokey
- The mod specific keyvalue
- A string valuepublic static void sendRuntimeMessage(java.lang.Object sourceMod, java.lang.String modId, java.lang.String key, ResourceLocation value)
sourceMod
- The mod sending the messagemodId
- The modid to send it tokey
- The mod specific keyvalue
- A string valuepublic static void sendRuntimeFunctionMessage(java.lang.Object sourceMod, java.lang.String modId, java.lang.String key, java.lang.String functionClassName)
sourceMod
- The mod originating this messagemodId
- The modid to send it tokey
- The mod specific keyfunctionClassName
- The name of a class to be loaded when the caller processes this message.
The named class must extend Function
private static boolean enqueueStartupMessage(java.lang.String modTarget, FMLInterModComms.IMCMessage message)
private static void enqueueMessage(java.lang.Object sourceMod, java.lang.String modTarget, FMLInterModComms.IMCMessage message)
public static com.google.common.collect.ImmutableList<FMLInterModComms.IMCMessage> fetchRuntimeMessages(java.lang.Object forMod)
forMod
- The Mod.Instance
of the Mod to fetch messages for