-
Notifications
You must be signed in to change notification settings - Fork 88
SpireSideload
Kiooeht edited this page Jan 15, 2020
·
1 revision
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)
@SpireInitializer
@SpireSideload(
modIDs = {
"otherModID"
}
)
public class ExampleMod
{
public static void initialize()
{
// ...
}
}
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.
@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
}
}