- Kotlin 100%
| .github/workflows | ||
| generated | ||
| gradle/wrapper | ||
| src | ||
| templates | ||
| .gitattributes | ||
| .gitignore | ||
| build.gradle | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| HEADER | ||
| LICENSE | ||
| README.md | ||
| settings.gradle | ||
fabric-language-kotlin
Fabric language module for Kotlin. Adds support for Kotlin exclusive entrypoints and bundles the Kotlin Stdlib as well as common kotlinx libraries.
Usage
Dependency
Add it as a dependency to your Gradle project:
dependencies {
modImplementation("net.fabricmc:fabric-language-kotlin:1.13.12+kotlin.2.4.0")
}
Adapter
Use the kotlin adapter for your mod by setting the adapter property in the fabric.mod.json file.
Remember to the add a dependency entry to your fabric.mod.json file:
{
"schemaVersion": 1,
"entrypoints": {
"main": [
{
"adapter": "kotlin",
"value": "package.ClassName"
}
]
},
"depends": {
"fabric-language-kotlin": ">=1.13.12+kotlin.2.4.0"
}
}
For more info reference the fabric.mod.json documentation.
Do not forget to set the schemaVersion to 1 or it will fall back to schema 0 and will not attempt to load entrypoints.
Entrypoint samples
| Kind | Class reference | Function reference | Field reference |
|---|---|---|---|
class |
|
||
object |
|
|
|
companion object |
|
|
|
top level |
File: |
Companion objects can be used by appending $Companion to the class.
Take care of processResources there, it might try to expand it, in that case escape it.
Bundled libraries
org.jetbrains.kotlin namespace:
org.jetbrains.kotlinx namespace:
kotlinx-coroutines-core1.11.0 Guide, API docs, GitHubkotlinx-coroutines-jdk81.11.0 API docskotlinx-serialization-core1.11.0 Guide, API docs, GitHubkotlinx-serialization-json1.11.0 API docskotlinx-serialization-cbor1.11.0 API docsatomicfu0.33.0 GitHubkotlinx-datetime0.8.0 GitHubkotlinx-io-core0.9.0 API docs, GitHubkotlinx-io-bytestring0.9.0 API docs
Available Versions
https://maven.fabricmc.net/net/fabricmc/fabric-language-kotlin/
Updating README
- Update the readme in
templates/README.template.md. - Run
./gradlew processMDTemplates.