Jump to content

All the things I need to make a mod that depends on other mods


Is.M.L

Recommended Posts

I'm trying to make a mod to better integrate a few features from other mods. I don't want to make it "kind of right" and later find out it doesn't work properly, so I'm asking this topic so someone can answer with a complete description of what needs to be done to achieve this.

Do I need to download the mods' deobfuscated jars to compile? Where do I put them?
What do I need to change in the @Modannotation?
What do I need to change in the mcmod.info file?
What do I need to change in the build.gradle file?
What's are the differences between a mod that requires another mod to be installed or just adds extra features if said other mod is installed?

How do I detect if another mod is running in my code?

Is there anything else I need to know?

This is what my mod currently looks like:

https://github.com/FourWingedKid/stoneyintegration

 

Link to comment
Share on other sites

3 hours ago, Is.M.L said:

Do I need to download the mods' deobfuscated jars to compile? Where do I put them?

Only if you want to either:

a) test in the development environment

b) using an exposed API

3 hours ago, Is.M.L said:

What do I need to change in the @Modannotation?

You need to add dependencies = "required-after:..." or  dependencies = "after:..." depending on hard or soft dependencies ("after" just loads your mod later, "required-after" means that the other mod MUST be present or your mod can't load).

3 hours ago, Is.M.L said:

What do I need to change in the mcmod.info file?

Technically, nothing, but you should add a "dependencies": ["..."] for any hard dependencies

3 hours ago, Is.M.L said:

What do I need to change in the build.gradle file?

If your not using an exposed API, nothing. Otherwise find and follow the directions in the dependencies block.

3 hours ago, Is.M.L said:

What's are the differences between a mod that requires another mod to be installed or just adds extra features if said other mod is installed?

The former uses if(Loader.isModLoaded(...)) to control logic (e.g. recipes) of itself. The latter uses API calls. For example: this.

3 hours ago, Is.M.L said:

How do I detect if another mod is running in my code?

See above

3 hours ago, Is.M.L said:

Is there anything else I need to know?

The @Optional annotation can allow you to move a hard-dependency to a soft-dependency. The only example I have is from 1.7.10 and I think the package changed.

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Thank you very much! An exemplar reply.

 

Just one doubt:

9 minutes ago, Draco18s said:

Technically, nothing, but you should add a "dependencies": ["..."] for any hard dependencies

Is the format of this dependencies field in mcmod.info the same as it is in the @Mod annotation? (i.e. either required-after:[modid] or after:[modid])

Edited by Is.M.L
Link to comment
Share on other sites

Yes, both use the modid where I put the ellipses and would be equivalent to required-after.

The mcmod.info file is not actually used by Forge for the most part, but is supposed to contain the same info as the @mod header so that websites like Curse can read the information.

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

7 minutes ago, Is.M.L said:

And the require-after, and after attributes too?

Those ones are used by Forge to determine the load order.  Not putting that may lead to your mod loading before your dependency, which would be bad.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.