Changes

Jump to navigation Jump to search
+ message sending in SMAPI 3.3
Line 89: Line 89:  
* When providing an API, the interface and implementation must be public.
 
* When providing an API, the interface and implementation must be public.
 
* When mapping an API to a custom interface using <tt>GetApi&lt;T&gt;</tt> (i.e. not using the mod's original interface), only the API interface itself can be proxied. Method return values and parameters must be types that both mods have access to (e.g. built-in types like <tt>bool</tt>, SMAPI types like <tt>IManifest</tt>, or game types like <tt>GameLocation</tt>).
 
* When mapping an API to a custom interface using <tt>GetApi&lt;T&gt;</tt> (i.e. not using the mod's original interface), only the API interface itself can be proxied. Method return values and parameters must be types that both mods have access to (e.g. built-in types like <tt>bool</tt>, SMAPI types like <tt>IManifest</tt>, or game types like <tt>GameLocation</tt>).
 +
 +
==Message sending==
 +
{{SMAPI upcoming|3.3}}
 +
 +
You can send messages using [[Modding:Modder Guide/APIs/Multiplayer|the multiplayer API]], with a destination ranging from very narrow (e.g. one mod on one connected computer) to very broad (all mods on all computers). Messages can also be sent to the current computer, e.g. to communicate between two mods. This can be used for a variety of integrations, including...
 +
 +
* Request something from a host mod. (For example, Tractor Mod uses this to summon a tractor to the current player in multiplayer, even if the tractor isn't in a location synced to that player.)
 +
* Notify another mod about something. (For example, Chests Anywhere uses this to notify Automate when a chest's automation options are edited.)
translators
8,403

edits

Navigation menu