-
Notifications
You must be signed in to change notification settings - Fork 0
Setup API
The API for developers can be found on CurseForge (as additional file(s)) in two formats: api and api-sources.
The former is the compiled version, and the latter is the original source-code version, which includes the javadocs.
First of all, in order to use the API we need to add it to our workspace.
For this we'll need to have CurseMaven to be defined in the repositories (the one for dependencies) block of our build.gradle:
repositories {
maven {
url = "https://www.cursemaven.com"
}
}To make sure Project Arsenal's API will only be available at compilation, and not while running the game, we'll be using Gradle's compileOnly for this:
dependencies {
/* Minecraft dependency here */
// {api_id} needs to be replaced with the file id of the API file found on CurseForge
// {api-sources_id} needs to be replaced with the file id of the API Sources file found on CurseForge
compileOnly fg.deobf('curse.maven:project-arsenal-api-683122:{api_id}-sources-{api-sources_id}')
}When appending the file id with
-sources-{file_id}, the sources file will automatically layer on top of the regular jar. This step is recommend as the sources jar includes the javadocs for the API.
File id's for version 0.3.3 of the API are as follows:
1.19.3-api:4454978,1.19.3-api-sources:44549791.19.2-api:4454975,1.19.2-api-sources:44549761.18.2-api:4454973,1.18.2-api-sources:44549741.16.5-api:4454971,1.16.5-api-sources:4454972
An optional dependency for Project Arsenal can be defined (in the mods.toml) like this:
[[dependencies.your_mod_id]]
modId="projectarsenal"
mandatory=false # or 'true' if you simply want your users to always have Project Arsenal installed
versionRange="[0.3.1,)"
ordering="NONE"
side="BOTH"Tip: You can tell users of your mod that there's Project Arsenal integration simply by adding Project Arsenal as an "Optional dependency" on CurseForge.
You can add Project Arsenal's main jar for testing to your development environment as well:
dependencies {
/* ...other dependencies */
// {file_id} needs to be replaced with the file of the main jar found on CurseForge
runtimeOnly fg.deobf('curse.maven:project-arsenal-683122:{file_id}')
}It is recommended to only add Project Arsenal's main jar as
runtimeOnlydependency, and to only use it for testing out the features. After testing it is better to remove the main jar again.
- Introduction
- Add API to workspace
- Implement API features
Can't find what you are looking for? Join our Discord server or create a discussion!