UberAffe Posted March 31, 2016 Share Posted March 31, 2016 I have not made an api before and I'm not really finding anything useful for what kind of things need to be availabe and how to make them available. In my case I have a few interfaces and classes that I want an addon to be able to interact with. //implement or extend these abstract class PartType interface IDraftable interface ILuxin //use static methods from these classes PartReg#RegisterPart(PartType part) CoreReg#RegisterCore(IDraftable core) LuxinReg#RegisterLuxin(ILuxin newLuxin) What would I need to do to make these available? Quote Current Project: Armerger Planned mods: Light Drafter | Ore Swords Looking for help getting a mod off the ground? Coding | Textures Link to comment Share on other sites More sharing options...
UberAffe Posted March 31, 2016 Author Share Posted March 31, 2016 So if someone was making an addon for my mod what would they use while programming. Do they just add my jar as a library in their build path or would I need to have something else for them to use? Quote Current Project: Armerger Planned mods: Light Drafter | Ore Swords Looking for help getting a mod off the ground? Coding | Textures Link to comment Share on other sites More sharing options...
UberAffe Posted March 31, 2016 Author Share Posted March 31, 2016 I don't know why I always assume things must be more complicated than my first impression. Since the library isn't getting built into their mod I assume I can just do something like github.com/UberAffe/Light-Drafter/API/LightDrafter-1.9-1.0-api.jar and as long as I don't change those classes then anything they build against that jar will work with the current version of my mod. Do I need to do anything to check for a minimum api version? Quote Current Project: Armerger Planned mods: Light Drafter | Ore Swords Looking for help getting a mod off the ground? Coding | Textures Link to comment Share on other sites More sharing options...
Draco18s Posted April 1, 2016 Share Posted April 1, 2016 An API is nothing special. An API is simply a set of classes / methods that you agree to not change. Unless you're Rieka. Or unless there's a good reason, in which case: 1) Mark them @Deprecated for at least 1 version and throw a warning to the console/log 2) Do your best to handle the old way if you can (e.g. if a method name, location, or paramters changed, create the new method and have the old, deprecated version point to it with a best-guess default for new parameters). I've got a few of these, from when I went "this class is handling more than it should be, I'm creating a new API interface for these" and moved them. https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/hardlib/api/interfaces/IHardRecipes.java#L58-L66 Quote 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 More sharing options...
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.