Posted May 31, 20187 yr Hi all, I made two mods that for simplicity we will call Mod A and Mod B. Mod A creates and adds a Capability<IMana> to EntityPlayer and works great. My requirement is to be able to read the capabilities of Mod A from mod B
May 31, 20187 yr Author 5 minutes ago, diesieben07 said: You access them the same way you would in Mod A. So I just need to recreate the same classes on Mod B and it will work?
May 31, 20187 yr Author 3 minutes ago, diesieben07 said: Ehm, what? No, you don't re-create anything. How do I make mod B obtain the capability? In the Mod A I just do: IMana mana = player.getCapability(ModCapabilities.MANA, null); if(mana!=null){ int value = mana.getMana(); } The problem is that Mod B does not know the "IMana and ModCapabilities.MANA" classes
May 31, 20187 yr You need to create the dependency, and make sure Mod A is present (in deobfuscated form) in the dev environment for Mod B as well the eventual run environment (in obfuscated form) for the user. Basically Mod A becomes a library to Mod B. Here's what I think you need to do (others can correct me): You would specify the dependency in Mod B's @Mod annotation. You would specify that Mod A loads before Mod B generally. Fill in the dependencies block in your build.gradle. (I think there are comments in the template that will guide you.) Add the deobfuscated version of Mod A source code jar to your Mod B project class path. I think that when you build your Mod A jar it also creates a deobfuscated version, but maybe you need to run special build option. Recommended to add a dependencies section in mcmod.info. This is informational. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
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.