This mod allows you to write kotlin mods/plugins without having to ship the kotlin runtime.
Thus avoiding conflicts with other mods/plugins.
It currently comes with kotlin version 2.3.10 and the following libraries :
- The standard library (jdk8)
- The reflection library
- The coroutines library
- The serialization library (json only)
- The kotlinx datetime library (for compat)
If you want to use other kotlin libraries, don't mind creating an issue.
This mod also supports android, although you should still avoid certain java 8 features.
Besides downloading this mod alongside your mod/plugin, you need to also make sure you do not include the kotlin stdlib when compiling your project. To do so, just add the following in your build script:
configurations.runtimeClasspath {
exclude("org.jetbrains.kotlin")
exclude("org.jetbrains.kotlinx")
}Or if you need precise exclusions:
configurations.runtimeClasspath {
exclude("org.jetbrains.kotlin", "kotlin-stdlib")
exclude("org.jetbrains.kotlin", "kotlin-stdlib-common")
exclude("org.jetbrains.kotlin", "kotlin-stdlib-jdk8")
exclude("org.jetbrains.kotlin", "kotlin-reflect")
// Add the following lines if you use coroutines
exclude("org.jetbrains.kotlinx", "kotlinx-coroutines-core")
exclude("org.jetbrains.kotlinx", "kotlinx-coroutines-jdk8")
// Add the following line if you use serialization
exclude("org.jetbrains.kotlinx", "kotlinx-serialization-core")
exclude("org.jetbrains.kotlinx", "kotlinx-serialization-json")
// Add the following line if you use datetime
exclude("org.jetbrains.kotlinx", "kotlinx-datetime")
}This mod requires Mindustry v154 or later and Java 8 or later.
./gradlew :mergeJarto only compile the mod (it will be located atbuild/libs/kotlin-runtime.jar)../gradlew :runMindustryServerto run the mod in a local Mindustry server../gradlew :runMindustryClientto run a local Mindustry client.