A full Java interop library that wraps Minecraft classes which allows you to write code for multiple versions at the same time. Built using ReplayMod's Preprocessor.
It's recommended that you include [Essential](link eventually) instead of adding it yourself.
In your repository block, add:
Groovy
maven {
url = "https://repo.essential.gg/repository/maven-public"
}
Kotlin
maven(url = "https://repo.essential.gg/repository/maven-public")
To use the latest builds, use the following dependency format, use the build reference to find the correct replacements:
Forge
implementation("gg.essential:universalcraft-$mcVersion-$mcPlatform:$buildNumber")
Fabric
Groovy
modImplementation(include("gg.essential:universalcraft-$mcVersion-$mcPlatform:$buildNumber"))
Kotlin
modImplementation(include("gg.essential:universalcraft-$mcVersion-$mcPlatform:$buildNumber")!!)
Build Reference
mcVersion | mcPlatform | buildNumber |
---|---|---|
1.18.1 | fabric | |
1.18.1 | forge | |
1.17.1 | fabric | |
1.17.1 | forge | |
1.16.2 | forge | |
1.12.2 | forge | |
1.8.9 | forge |
If you are using forge, you must also relocate UC to avoid potential crashes with other mods. To do this, you will need to use the Shadow Gradle plugin.
Groovy Version
You can do this by either putting it in your plugins block:
plugins {
id "com.github.johnrengelman.shadow" version "$version"
}
or by including it in your buildscript's classpath and applying it:
buildscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath "gradle.plugin.com.github.jengelman.gradle.plugins:shadow:$version"
}
}
apply plugin: "com.github.johnrengelman.shadow"
You'll then want to relocate UC to your own package to avoid breaking other mods
shadowJar {
archiveClassifier.set(null)
relocate("gg.essential.universal", "your.package.universal")
}
tasks.named("reobfJar").configure { dependsOn(tasks.named("shadowJar")) }
Kotlin Script Version
You can do this by either putting it in your plugins block:
plugins {
id("com.github.johnrengelman.shadow") version "$version"
}
or by including it in your buildscript's classpath and applying it:
buildscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath("gradle.plugin.com.github.jengelman.gradle.plugins:shadow:$version")
}
}
apply(plugin = "com.github.johnrengelman.shadow")
You'll then want to relocate UC to your own package to avoid breaking other mods
tasks.shadowJar {
archiveClassifier.set(null)
relocate("gg.essential.universal", "your.package.universal")
}
tasks.reobfJar { dependsOn(tasks.shadowJar) }