To use IF in a Gradle project, add the dependency to your dependencies block and ensure mavenCentral() is in your repositories block.
You must use the shadowJar plugin to include IF in your final artifact. Relocate the classes to your own namespace to prevent conflicts.
Paper Compatibility: If targeting Paper versions before 26.1, you must set the paperweight-mappings-namespace attribute to spigot within the shadowJar manifest configuration.
// Dependencies
dependencies {
implementation 'com.github.stefvanschie.inventoryframework:IF:0.12.0'
}
// Repositories
repositories {
mavenCentral()
}
// Shadowing and Relocation
plugins {
id "com.gradleup.shadow" version "9.4.1"
}
shadowJar {
relocate 'com.github.stefvanschie.inventoryframework', '[YOUR PACKAGE].inventoryframework'
// Required for Paper plugins targeting versions < 26.1
manifest {
attributes 'paperweight-mappings-namespace': 'spigot'
}
}