Send IMC to remote. Sender will default to the active modcontainer, or minecraft if not. @param modId the mod id to send to @param method the method name to send @param thing the thing associated with the method name @return true if the message was enqueued for sending (the target modid is loaded)
(final String modId, final String method, final Supplier<?> thing)
| 90 | * @return true if the message was enqueued for sending (the target modid is loaded) |
| 91 | */ |
| 92 | public static boolean sendTo(final String modId, final String method, final Supplier<?> thing) { |
| 93 | if (!ModList.get().isLoaded(modId)) return false; |
| 94 | containerQueues.computeIfAbsent(modId, k->new ConcurrentLinkedQueue<>()).add(new IMCMessage(ModLoadingContext.get().getActiveContainer().getModId(), modId, method, thing)); |
| 95 | return true; |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Send IMC to remote. |