autaut03 / kottle

Kotlin language provider for Forge 1.13.2+
GNU Lesser General Public License v3.0
30 stars 13 forks source link

Kottle

Build Status Downloads Versions

Kotlin language provider for Forge 1.13-1.15. Originally a rewrite of Shadowfacts's Forgelin.

Usage

First of all, make sure you're on Forge 31.0.0 or higher.

Then, in your build.gradle:

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        // Remove this line: classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
        // trove is forked and used by kotlin and we have to use it instead of the one forked by Forge
        // to avoid compilation errors on Linux (see PR #2)
        classpath(group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true) {
            exclude group: 'trove', module: 'trove'
        }
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
    }
}

apply plugin: 'kotlin'

repositories {
    maven { url 'https://minecraft.curseforge.com/api/maven/' }
}

dependencies {
    implementation "kottle:Kottle:$kottleVersion"
}

, in your gradle.properties:

# This is your kotlin gradle plugin version. For now, use 1.3.61.
kotlinVersion = 1.3.61

# Change this to the most recent release version from CurseForge
kottleVersion = 1.5.2

, in your mods.toml:

modLoader="kotlinfml"
loaderVersion="[1,)"

Finally, replace FMLJavaModLoadingContext references in your code with FMLKotlinModLoadingContext.

For more info, checkout test sources here or my mod, Roomery, here.

FAQ