public static final class FMLInterModComms.IMCMessage
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.lang.String |
key
This field, and
value are both at the mod's discretion |
Modifier and Type | Method and Description |
---|---|
<T,V> java.util.Optional<java.util.function.Function<T,V>> |
getFunctionValue(java.lang.Class<T> functionFrom,
java.lang.Class<V> functionTo)
Get the
Function value from this message. |
ItemStack |
getItemStackValue()
Get the
ItemStack value from this message |
java.lang.Class<?> |
getMessageType()
Get the actual message class type
|
NBTTagCompound |
getNBTValue()
Get the
NBTTagCompound value from this message |
ResourceLocation |
getResourceLocationValue()
Get the ResourceLocation value from this message.
|
java.lang.String |
getSender()
Get the sending modId of this message.
|
java.lang.String |
getStringValue()
Get the string value from this message.
|
boolean |
isFunctionMessage()
Is this a
Function type message |
boolean |
isItemStackMessage()
Is this an
ItemStack type message |
boolean |
isNBTMessage()
Is this an
NBTTagCompound type message |
boolean |
isResourceLocationMessage()
Is this an
ResourceLocation type message |
boolean |
isStringMessage()
Is this a string type message
|
java.lang.String |
toString() |
@Nonnull public final java.lang.String key
value
are both at the mod's discretionpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getSender()
public java.lang.String getStringValue()
java.lang.ClassCastException
- if this message doesn't contain a String valuepublic ResourceLocation getResourceLocationValue()
java.lang.ClassCastException
- if this message doesn't contain a ResourceLocation valuepublic NBTTagCompound getNBTValue()
NBTTagCompound
value from this messagejava.lang.ClassCastException
- if this message doesn't contain an NBT value@Nonnull public ItemStack getItemStackValue()
ItemStack
value from this messagejava.lang.ClassCastException
- if this message doesn't contain an Itemstack valuepublic <T,V> java.util.Optional<java.util.function.Function<T,V>> getFunctionValue(java.lang.Class<T> functionFrom, java.lang.Class<V> functionTo)
Function
value from this message. This will attempt to classload the function
supplied by the caller. The parameter classes are strictly to give a concrete generic function return value.T
- The argument typeV
- The result typefunctionFrom
- The type of the argument to the functionfunctionTo
- The type of the result of the functionpublic java.lang.Class<?> getMessageType()
public boolean isStringMessage()
public boolean isItemStackMessage()
ItemStack
type messagepublic boolean isNBTMessage()
NBTTagCompound
type messagepublic boolean isResourceLocationMessage()
ResourceLocation
type messagepublic boolean isFunctionMessage()
Function
type message