diff --git a/src/main/java/net/minecraftforge/fml/common/event/FMLInterModComms.java b/src/main/java/net/minecraftforge/fml/common/event/FMLInterModComms.java index 0be1af0350..caf03a04fe 100644 --- a/src/main/java/net/minecraftforge/fml/common/event/FMLInterModComms.java +++ b/src/main/java/net/minecraftforge/fml/common/event/FMLInterModComms.java @@ -16,6 +16,7 @@ import com.google.common.base.Function; import com.google.common.base.Optional; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.FMLLog; import net.minecraftforge.fml.common.Loader; @@ -131,6 +132,15 @@ public class FMLInterModComms { { return (String) value; } + /** + * Get the ResourceLocation value from this message. + * @throws ClassCastException if this message doesn't contain a ResourceLocation value + * @return The string value + */ + public ResourceLocation getResourceLocationValue() + { + return (ResourceLocation) value; + } /** * Get the {@link NBTTagCompound} value from this message @@ -242,6 +252,18 @@ public class FMLInterModComms { return enqueueStartupMessage(modId, new IMCMessage(key, value)); } + /** + * Send a startup time message + * @param modId The modid to send it to + * @param key The mod specific key + * @param value A ResourceLocation value + * @return if the message was enqueued successfully and will be processed during startup + */ + public static boolean sendMessage(String modId, String key, ResourceLocation value) + { + return enqueueStartupMessage(modId, new IMCMessage(key, value)); + } + /** * Send a startup time message * @param modId The modid to send it to @@ -253,7 +275,6 @@ public class FMLInterModComms { { return enqueueStartupMessage(modId, new IMCMessage(key, value)); } - /** * Send a startup time function message * @param modId The modid to send it to @@ -303,6 +324,17 @@ public class FMLInterModComms { enqueueMessage(sourceMod, modId, new IMCMessage(key, value)); } + /** + * Send a post-startup message + * @param sourceMod The mod sending the message + * @param modId The modid to send it to + * @param key The mod specific key + * @param value A string value + */ + public static void sendRuntimeMessage(Object sourceMod, String modId, String key, ResourceLocation value) + { + enqueueMessage(sourceMod, modId, new IMCMessage(key, value)); + } /** * Send a post-startup function message. *