Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thedarkcolour/kotlinforforge
Makes Kotlin forge-friendly.
https://github.com/thedarkcolour/kotlinforforge
kotlin minecraft-api minecraft-forge
Last synced: 25 days ago
JSON representation
Makes Kotlin forge-friendly.
- Host: GitHub
- URL: https://github.com/thedarkcolour/kotlinforforge
- Owner: thedarkcolour
- License: lgpl-2.1
- Created: 2019-11-03T19:56:42.000Z (about 5 years ago)
- Default Branch: 4.x
- Last Pushed: 2024-08-09T17:30:02.000Z (3 months ago)
- Last Synced: 2024-10-14T06:43:26.147Z (25 days ago)
- Topics: kotlin, minecraft-api, minecraft-forge
- Language: Kotlin
- Homepage:
- Size: 96.9 MB
- Stars: 187
- Watchers: 4
- Forks: 26
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# KotlinForForge
**Instructions for other versions: [1.20.6](https://github.com/thedarkcolour/KotlinForForge/blob/5.x/README.md) | [1.19.2](https://github.com/thedarkcolour/KotlinForForge/blob/3.x/README.md) | [1.14-1.16.5](https://github.com/thedarkcolour/KotlinForForge/blob/1.x/README.md) | [1.17-1.17.1](https://github.com/thedarkcolour/KotlinForForge/blob/2.x/README.md)**Makes Kotlin Forge-friendly by doing the following:
- Provides Kotlin stdlib, reflection, JSON serialization, and coroutines libraries.
- Provides `KotlinLanguageProvider` to allow usage of object declarations as @Mod targets.
- Provides `AutoKotlinEventBusSubscriber` to allow usage of object declarations as @Mod.EventBusSubscriber targets.
- Provides useful utility functions and constantsA 1.19.3 (works for 1.19.4 too) example mod is provided here: [1.19.3 KotlinModdingSkeleton repository](https://github.com/thedarkcolour/KotlinModdingSkeleton/tree/1.19.3)
A 1.20 example mod is provided here: [1.20 KotlinModdingSkeleton repository](https://github.com/thedarkcolour/KotlinModdingSkeleton/tree/1.20)
A 1.20.6 example mod is provided here: [1.20.6 KotlinModdingSkeleton repository](https://github.com/thedarkcolour/KotlinModdingSkeleton/tree/1.20.6-neoforge)If you aren't sure where to start, make a fork of the KotlinModdingSkeleton repository (replace BRANCH with your version)
```git
git clone --branch BRANCH https://github.com/thedarkcolour/KotlinModdingSkeleton.git
```To implement in an existing project, merge the following into your build script:
Gradle
```groovy
plugins {
// Adds the Kotlin Gradle plugin
id 'org.jetbrains.kotlin.jvm' version '1.9.22'
// OPTIONAL Kotlin Serialization plugin
id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.22'
}repositories {
// Add KFF Maven repository
maven {
name = 'Kotlin for Forge'
url = 'https://thedarkcolour.github.io/KotlinForForge/'
}
}dependencies {
// Adds KFF as dependency and Kotlin libs (use the variant matching your mod loader)
// FORGE
implementation 'thedarkcolour:kotlinforforge:4.10.0'
// NEOFORGE
implementation 'thedarkcolour:kotlinforforge-neoforge:4.10.0'
}
```Gradle (Kotlin)
```kotlin
plugins {
// Adds the Kotlin Gradle plugin
kotlin("jvm") version "1.9.22"
// OPTIONAL Kotlin Serialization plugin
kotlin("plugin.serialization") version "1.9.22"
}repositories {
// Add KFF Maven repository
maven {
name = "Kotlin for Forge"
setUrl("https://thedarkcolour.github.io/KotlinForForge/")
}
}dependencies {
// Adds KFF as dependency and Kotlin libs (use the variant matching your mod loader)
// FORGE
implementation("thedarkcolour:kotlinforforge:4.10.0")
// NEOFORGE
implementation("thedarkcolour:kotlinforforge-neoforge:4.10.0")
}
```Then, change the following to your mods.toml file:
```toml
modLoader="kotlinforforge"
# Change this if you require a certain version of KotlinForForge
loaderVersion="[4.10,)"
```Use
```thedarkcolour.kotlinforforge.forge.MOD_CONTEXT```
instead of ```net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext```