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 also features a "standalone" edition, which can run GUIs without Minecraft so long as they only depend on
UniversalCraft and not Minecraft directly.
This can allow for a faster development loop (no need to wait a minute for Minecraft to start),
automated testing without having to bootstrap a full Minecraft environment,
and even development of completely standalone applications using the same toolkit (e.g. [Elementa]) as one is already
familiar with from Minecraft development.
See the standalone/example/
folder for a fully functional example.
It's recommended that you include [Essential](link eventually) instead of adding it yourself.
In your repository block, add:
Groovy
maven {
url = "https://repo.polyfrost.cc/releases"
}
Kotlin
maven(url = "https://repo.polyfrost.cc/releases")
To use the latest builds, use the following dependency format, use the build reference to find the correct replacements:
Forge
implementation("org.polyfrost:universalcraft-$mcVersion-$mcPlatform:$buildNumber")
Fabric
Groovy
modImplementation(include("org.polyfrost:universalcraft-$mcVersion-$mcPlatform:$buildNumber"))
Kotlin
modImplementation(include("org.polyfrost:universalcraft-$mcVersion-$mcPlatform:$buildNumber")!!)
Build Reference
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) }