Lib integration - ITsMrToad/ToadLib-mod GitHub Wiki

1. Add maven.modrinth to repositories

//For all loaders

repositories {
    exclusiveContent {
        forRepository {
            maven {
                name = "Modrinth"
                url = "https://api.modrinth.com/maven"
            }
        }
        forRepositories(fg.repository) 
        filter {
            includeGroup "maven.modrinth"
        }
    }
}

2. Add ToadLib to dependencies in build.gradle

Forge:

implementation fg.deobf("maven.modrinth:toadlib:<version>") //Forge

Fabric:

modApi("maven.modrinth:toadlib:${project.toadlib_version}") {
	exclude module: "fabric-api"
}
  • Replace "${project.toadlib_version}" with the desired version of ToadLib, or declare toadlib_version in gradle.properties
  • For example: version - 1.0.1 / toadlib_version = 1.0.1 //in gradle.properties

3. Add ToadLib to dependencies(Optional)

Forge:

[[dependencies.{yourModId}]]
modId = "toadlib"
mandatory = true # For neoforge is "type = required"
versionRange = "${toadlib_version_range}"
ordering = "BEFORE" # For the config (I guess).
side = "BOTH"

Fabric:

"depends": {
   "toadlib-fabric": "${toadlib_version_range}",		
},
  • Replace "${toadlib_version_range}" with the desired version of ToadLib, or declare toadlib_version_range in gradle.properties
  • For example: [1.0.1, ) or >=1.0.1 (Fabric) / toadlib_version_range= [1.0.1, ) //in gradle.properties
  • build your mod.

Note

"${toadlib_version}"from step 2. >= "${toadlib_version_range}" in step 3. Outherwise it will lead to exception You may not add a dependency, but classes related to ToadLib will not be loaded if it is not installed (This may also cause exceptions). Adding in a dependency will notify users that ToadLib is required for your mod.

⚠️ **GitHub.com Fallback** ⚠️