crashtua Posted February 10, 2013 Posted February 10, 2013 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? Quote
mnn Posted February 10, 2013 Posted February 10, 2013 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") Quote mnn.getNativeLang() != English If I helped you please click on the "thank you" button.
Hunternif Posted August 31, 2013 Posted August 31, 2013 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) 1 Quote I made Moses Mod, Dota 2 Items Mod, Rings of Power and Antique Atlas.
Recommended Posts
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.