SpireSideload - kiooeht/ModTheSpire GitHub Wiki
Sideloading Another Mod
The @SpireSideload
annotation allows a mod to load another mod even if it wasn't selected to be loaded by the user.
- Must be put on the same class as SpireInitializer.
- Will only work if the mod to be sideloaded has been downloaded by the user.
You can check if a mod has been loaded or sideloaded with the following functions:
Loader.isModLoaded(modID)
Loader.isModSideloaded(modID)
Loader.isModLoadedOrSideloaded(modID)
Example
@SpireInitializer
@SpireSideload(
modIDs = {
"otherModID"
}
)
public class ExampleMod
{
public static void initialize()
{
// ...
}
}
Being Sideloaded
If a mod defines a sideload
method in the same class it has @SpireInitializer
on, that method will be called instead of initialize
if the mod is sideloaded by another mod. This can be used to load only part of your mod when sideloaded.
Example
@SpireInitializer
public class SideloadedMod
{
public static void initialize()
{
// Called if explicitly loaded by the player
}
public static void sideload()
{
// Called if another mod sideloads this mod
}
}