This is the Thread about the IC2 API and IC2 Addons. If you have a Question about the API or the Dev Environment, you can post it here. If you look for the License Stuff then go here
API shipping
If you make an IC2 Addon where IC2 is always installed, you do not need to ship this API inside your Mod, since it is already contained in IC2 itself. So when you compile your Mod do not zip/jar up the IC2 API itself, because then your old IC2 API can accidentally override the IC2 API of IC2 itself what causes crashes.
If IC2 is not always installed (optional) you can use FML's @Optional annotation to strip missing interfaces at load-time. If you also don't call IC2 code without checking if IC2 is available first, the API isn't even required if IC2 is not installed. Calls to missing classes should only crash when the call actually happens, unreachable calls, e.g. due to a false if clause, don't.
Summary: There's no need to ship the API ever.
IDE / Eclipse / Dev environment
Start with a normal Forge workspace using the Forge src zip, extracting it, running gradle(w) setupDecomWorkspace and gradle(w) eclipse and importing it into Eclipse.
If you want to you can create a separate project for IC2 or just add IC2 to Forge's project. Add the IC2 dev jar as a library to the build path. You can get it from http://jenkins.ic2.player.to/job/IC2_experimental/, the file name is "industrialcraft-x-x.x.xxx-experimental-dev.jar" (should be the second one). It also needs to be copied to your eclipse working (run) directory's mods-Folder.
A Documentation of the API: http://ic2api.player.to/ic2api/html/annotated.html
build.gradle
A maven compatible repository for the api an dev jars is available at http://maven.ic2.player.to.
Add the following to your build.gradle to use it, adjusting the version number as needed:
repositories {
maven {
name = "ic2"
url = "http://maven.ic2.player.to/"
}
}
dependencies {
compile 'net.industrial-craft:industrialcraft-2:2.1.470-experimental:api'
}
Display More
1.8.9:
repositories {
maven {
name = "ic2"
url = "http://maven.ic2.player.to/"
}
}
dependencies {
compile 'net.industrial-craft:industrialcraft-2:2.3.225-ex18:api'
}
Display More
Note that the repositories block is different/outside the existing "buildscript { repositories {} }" block. Ordering matters in build.gradle.
If you use IC2 core functionality, which isn't recommended, you have to replace api with dev at the end of dependencies - compile. Alternatively, you can use forged "deobfCompile" with the normal jar file instead of the dev one. This will make sure, that it will work no matter if you use different mappings than we use.