Class InterModComms


  • public class InterModComms
    extends java.lang.Object
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • containerQueues

        private static java.util.concurrent.ConcurrentMap<java.lang.String,​java.util.concurrent.ConcurrentLinkedQueue<InterModComms.IMCMessage>> containerQueues
    • Constructor Detail

      • InterModComms

        public InterModComms()
    • 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 to
        method - the method name to send
        thing - 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 from
        modId - the mod id to send to
        method - the method name to send
        thing - 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 for
        methodMatcher - 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