Firstly, I'd seriously consider developing for 1.8.9/1.10.2 instead of 1.7.10. Porting mods between versions is a bit of a pain, so if you're going in fresh I'd just start using as recent a version as possible. Anyway, in order to depend on ComputerCraft: you basically have two options:
Embedding the APIThis is the "standard" way of including APIs. It makes it easier to work with the source, but does mean you have to keep the API up to date with the mod's version.
If you open the CC jar as a zip file (using something like 7zip, or your OS's built in archiver), you'll see an
api/src folder. You want to extract that to the "src/api/java" directory, so you have
something like this.
You should now be able to use the CC APIs. You may need to re-generate the project files if they don't show up immediately. Note, you'll also need to copy the CC jar into the
run/mods folder for it to be loaded at runtime.
Adding as a dependencyThis is the method I use in my mods. It makes it slightly easier to manage versions as you aren't bundling anything.
Open your
build.gradle file and add the following code:
repositories {
ivy {
name = "ComputerCraft"
artifactPattern "http://addons-origin.cursecdn.com/files/2269/339/[module][revision](.[ext])"
}
}
dependencies {
compile "ComputerCraft:ComputerCraft:1.75"
}
Please be aware that the version numbers and repository strings are different for different versions of the mods. There is a list of
version strings here.
Note, in both cases you may need to install
CodeChickenCore: this allows obfuscated mods to run in a deobfuscated environment. Be aware that this is only needed in 1.7.10, Forge for 1.8.9+ does this automatically.