← Назад к ресурсам

KotlinLangForge

Provides a Kotlin language adapter for Forge and Neoforge

Modrinth library

Описание

# KotlinLangForge > Provides a Kotlin language adapter for Forge and Neoforge This mod adds a language adapter for Kotlin and provides multiple libraries. ## Developer usage To add your language adapter to your mod, add the following lines to your (neoforge.)mods.toml. **neoforge.mods.toml** ```toml modLoader = "klf" loaderVersion = "[1,)" ``` Now you can init your mod like any other. Just make sure your `@Mod` class is either an object or a class with a public constructor. The constructor can take the following four arguments (they should never duplicate): - IEventBus - ModContainer - KotlinModContainer - Dist If you want to implement the libraries in your mod, import the following dependency, matching the language provider version, your loader and the (latest) version of Kotlin. **Versioning** The "language provider version" is a version only provided by KotlinLangForge. This format is not used by Forge or NeoForge and only serves as a simple differentiation variable between the different language provider implementations over the course of the versions of Minecraft. | version of Minecraft | language provider version | supported loaders | |----------------------|---------------------------|-------------------| | 1.16.5 | 1.0 | Forge | | 1.17.1 - 1.20.4 | 2.0 | Forge, NeoForge | | 1.20.5 - 1.21.8 | 3.0 | NeoForge | | 1.21.9 - 26.x | 3.1 | NeoForge | **build.gradle.kts** ```kotlin repositories { maven("https://repo.nyon.dev/releases") } dependencies { implementation("dev.nyon:KotlinLangForge:2.14.0-k2.4.20-$lpVersion+$loader") } ``` *For lp: