Class InterModComms

java.lang.Object
net.minecraftforge.fml.InterModComms

public class InterModComms extends Object
  • Field Details

  • Constructor Details

    • InterModComms

      public InterModComms()
  • Method Details

    • sendTo

      public static boolean sendTo(String modId, String method, 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(String senderModId, String modId, String method, 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 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 for
      methodMatcher - a predicate for the method you are interested in
      Returns:
      All messages passing the supplied method predicate
    • getMessages

      public static Stream<InterModComms.IMCMessage> getMessages(String modId)
      Retrieve all message for your modid.
      Parameters:
      modId - the modid you are querying for
      Returns:
      All messages