Package net.minecraftforge.fml
Class InterModComms
- java.lang.Object
-
- net.minecraftforge.fml.InterModComms
-
public class InterModComms extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InterModComms.IMCMessage
private static class
InterModComms.QueueFilteringSpliterator
-
Field Summary
Fields Modifier and Type Field Description private static java.util.concurrent.ConcurrentMap<java.lang.String,java.util.concurrent.ConcurrentLinkedQueue<InterModComms.IMCMessage>>
containerQueues
-
Constructor Summary
Constructors Constructor Description InterModComms()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.stream.Stream<InterModComms.IMCMessage>
getMessages(java.lang.String modId)
Retrieve all message for your modid.static java.util.stream.Stream<InterModComms.IMCMessage>
getMessages(java.lang.String modId, java.util.function.Predicate<java.lang.String> methodMatcher)
Retrieve pending messages for your modid.static boolean
sendTo(java.lang.String senderModId, java.lang.String modId, java.lang.String method, java.util.function.Supplier<?> thing)
Send IMC to remote.static boolean
sendTo(java.lang.String modId, java.lang.String method, java.util.function.Supplier<?> thing)
Send IMC to remote.
-
-
-
Field Detail
-
containerQueues
private static java.util.concurrent.ConcurrentMap<java.lang.String,java.util.concurrent.ConcurrentLinkedQueue<InterModComms.IMCMessage>> containerQueues
-
-
Method Detail
-
sendTo
public static boolean sendTo(java.lang.String modId, java.lang.String method, java.util.function.Supplier<?> thing)
Send IMC to remote. Sender will default to the active modcontainer, or minecraft if not.- Parameters:
modId
- the mod id to send tomethod
- the method name to sendthing
- the thing associated with the method name- Returns:
- true if the message was enqueued for sending (the target modid is loaded)
-
sendTo
public static boolean sendTo(java.lang.String senderModId, java.lang.String modId, java.lang.String method, java.util.function.Supplier<?> thing)
Send IMC to remote.- Parameters:
senderModId
- the mod id you are sending frommodId
- the mod id to send tomethod
- the method name to sendthing
- the thing associated with the method name- Returns:
- true if the message was enqueued for sending (the target modid is loaded)
-
getMessages
public static java.util.stream.Stream<InterModComms.IMCMessage> getMessages(java.lang.String modId, java.util.function.Predicate<java.lang.String> methodMatcher)
Retrieve pending messages for your modid. Use the predicate to filter the method name.- Parameters:
modId
- the modid you are querying formethodMatcher
- a predicate for the method you are interested in- Returns:
- All messages passing the supplied method predicate
-
getMessages
public static java.util.stream.Stream<InterModComms.IMCMessage> getMessages(java.lang.String modId)
Retrieve all message for your modid.- Parameters:
modId
- the modid you are querying for- Returns:
- All messages
-
-