Jump to content

[Solved] How to make one mod depends on another?


crashtua

Recommended Posts

I want to bring some general functions of my mods in one separate mod (create something like API). How I can do this? Every mod in forge is singleton, so, can I call required API methods from API. instance? If I can, and how I will know if mod named API was already initialized? It must be initialized before any dependent mod use it. Is there a way to set mod load order?

Link to comment
Share on other sites

Take a look at Mod annotation (I think it's what you want).

example:

@Mod(modid = "moen-jaffas-power", name = "Jaffas - power", version = Reference.Version, dependencies = "required-after:moen-jaffas;required-after:moen-monnef-core")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class mod_jaffas_power {
...

 

EDIT:

there is also soft dependency - without the "required" part, e.g.:

@Mod(modid = Reference.ModId, name = Reference.ModName, version = Reference.Version, dependencies = "after:Forestry;after:BuildCraft|Energy;after:ExtrabiomesXL")

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

Link to comment
Share on other sites

  • 6 months later...

Replying for the sake of google. You can add dependencies "before" and "after", as well as specify required vesions:

"required-after:mod1@[1.0,)" - This means you require a mod with id "mod1" of version 1.0 and higher to be loaded before your mod.

See javadoc for cpw.mods.fml.common.versioning.VersionRange.createFromVersionSpec(String spec)

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.