Skip to content

A Minecraft modding library designed to seamlessly support a single code base branching different Minecraft versions and LWJGL versions

License

Notifications You must be signed in to change notification settings

Polyfrost/UniversalCraft

 
 

Repository files navigation

UniversalCraft

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.

Dependency

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

Build Reference
1.21fabric1.21-fabric
1.20.6fabric1.20.6-fabric
1.20.4forge1.20.4-forge
1.20.4fabric1.20.4-fabric
1.20.2forge1.20.2-forge
1.20.2fabric1.20.2-fabric
1.20.1forge1.20.1-forge
1.20.1fabric1.20.1-fabric
1.20fabric1.20-fabric
1.19.4forge1.19.4-forge
1.19.4fabric1.19.4-fabric
1.19.3forge1.19.3-forge
1.19.3fabric1.19.3-fabric
1.19.2forge1.19.2-forge
1.19.2fabric1.19.2-fabric
1.19.1fabric1.19.1-fabric
1.19fabric1.19-fabric
1.18.2forge1.18.2-forge
1.18.2fabric1.18.2-fabric
1.17.1forge1.17.1-forge
1.17.1fabric1.17.1-fabric
1.16.5fabric1.16.5-fabric
1.16.5forge1.16.5-forge
1.12.2forge1.12.2-forge
1.12.2fabric1.12.2-fabric
1.8.9fabric1.8.9-fabric
1.8.9forge1.8.9-forge

IMPORTANT!

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) }
[Elementa]: https://github.com/EssentialGG/Elementa

About

A Minecraft modding library designed to seamlessly support a single code base branching different Minecraft versions and LWJGL versions

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 81.4%
  • Java 18.6%