Stop recommending that mods depend on an optional dependency via runtimeOnly (#48)

* Stop recommending that mods depend on an optional dependency via runtimeOnly

* Switch forge in dep to neoforge

* Make comment more intuitive
This commit is contained in:
Luke Bemish 2024-04-28 00:48:11 -05:00 committed by GitHub
parent 6074a78fba
commit a780f5831b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -72,6 +72,13 @@ runs {
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
// Sets up a dependency configuration called 'localRuntime'.
// This configuration should be used instead of 'runtimeOnly' to declare
// a dependency that will be present for runtime testing but that is
// "optional", meaning it will not be pulled by dependents of this mod.
configurations {
runtimeClasspath.extendsFrom localRuntime
}
dependencies {
// Specify the version of Minecraft to use.
@ -82,11 +89,12 @@ dependencies {
// For all intends and purposes: You can treat this dependency as if it is a normal library you would use.
implementation "net.neoforged:neoforge:${neo_version}"
// Example mod dependency with JEI
// Example optional mod dependency with JEI
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
// compileOnly "mezz.jei:jei-${mc_version}-common-api:${jei_version}"
// compileOnly "mezz.jei:jei-${mc_version}-forge-api:${jei_version}"
// runtimeOnly "mezz.jei:jei-${mc_version}-forge:${jei_version}"
// compileOnly "mezz.jei:jei-${mc_version}-neoforge-api:${jei_version}"
// We add the full version to localRuntime, not runtimeOnly, so that we do not publish a dependency on it
// localRuntime "mezz.jei:jei-${mc_version}-neoforge:${jei_version}"
// Example mod dependency using a mod jar from ./libs with a flat dir repository
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar