mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Support ResLocations for IMC
This commit is contained in:
1 parent
4c8da35655
commit
efcb9ee570
1 file changed
+33
-1
@@ -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.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user