Package net.minecraftforge.fml
Class InterModComms
java.lang.Object
net.minecraftforge.fml.InterModComms
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
private static class
-
Field Summary
Modifier and TypeFieldDescriptionprivate static ConcurrentMap
<String, ConcurrentLinkedQueue<InterModComms.IMCMessage>> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Stream
<InterModComms.IMCMessage> getMessages
(String modId) Retrieve all message for your modid.static Stream
<InterModComms.IMCMessage> getMessages
(String modId, Predicate<String> methodMatcher) Retrieve pending messages for your modid.static boolean
Send IMC to remote.static boolean
Send IMC to remote.
-
Field Details
-
containerQueues
private static ConcurrentMap<String,ConcurrentLinkedQueue<InterModComms.IMCMessage>> containerQueues
-
-
Constructor Details
-
InterModComms
public InterModComms()
-
-
Method Details
-
sendTo
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
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 Stream<InterModComms.IMCMessage> getMessages(String modId, Predicate<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
Retrieve all message for your modid.- Parameters:
modId
- the modid you are querying for- Returns:
- All messages
-