Changes

Jump to navigation Jump to search
Line 85: Line 85:  
* You can't call <samp>GetApi</samp> until all mods are initialised and their <samp>Entry</samp> methods called. You can use the <samp>GameLoop.GameLaunched</samp> [[#Events|event]] if you need to access mod APIs early; this is guaranteed to happen after all mods are initialised.
 
* You can't call <samp>GetApi</samp> until all mods are initialised and their <samp>Entry</samp> methods called. You can use the <samp>GameLoop.GameLaunched</samp> [[#Events|event]] if you need to access mod APIs early; this is guaranteed to happen after all mods are initialised.
 
* You should always null-check APIs you consume. <samp>GetApi</samp> will return <samp>null</samp> if the API isn't available (''e.g.,'' because the mod isn't already installed or doesn't have one), or if an error occurs fetching the API.
 
* You should always null-check APIs you consume. <samp>GetApi</samp> will return <samp>null</samp> if the API isn't available (''e.g.,'' because the mod isn't already installed or doesn't have one), or if an error occurs fetching the API.
 +
* Keep in mind that mods may change their API interfaces over time; it may be useful to check the version of the other mod before trying to map the interface.
    
===Known limitations===
 
===Known limitations===
528

edits

Navigation menu