Forgelin/README.md

39 lines
1.3 KiB
Markdown
Raw Normal View History

2016-08-06 14:40:14 +00:00
# Forgelin
2016-11-14 15:53:45 +00:00
Fork of [Emberwalker's Forgelin](https://github.com/Emberwalker/Forgelin).
2016-08-06 14:40:14 +00:00
2019-02-12 21:58:28 +00:00
All versions can be found [here](http://maven.shadowfacts.net/net/shadowfacts/Forgelin/).
2016-08-06 14:40:14 +00:00
## Additions
2016-11-14 15:53:45 +00:00
- Shades the Kotlin standard library, runtime, and reflect libraries so you don't have to.
2019-02-12 21:58:28 +00:00
- Provides a Forge `IModLanguageProvider` for using Kotlin `object` classes as your main mod class and adds support for
`object` instances for `@Mod.EventBusSubscriber`
2016-08-06 14:40:14 +00:00
## Usage
2019-02-12 21:58:28 +00:00
Set up your default Kotlin dev environment (IDEA can help you with that), then in your `build.gradle`:
2016-08-06 14:40:14 +00:00
```groovy
repositories {
jcenter()
2019-02-12 21:58:28 +00:00
maven { url 'https://maven.shadowfacts.net' }
2016-08-06 14:40:14 +00:00
}
dependencies {
2019-02-12 21:58:28 +00:00
compile group: 'net.shadowfacts', name: 'Forgelin', version: 'LATEST_VERSION'
2016-08-06 14:40:14 +00:00
}
```
2019-02-12 21:58:28 +00:00
**Note:** You must have the `jcenter()` call in your `repositories` block. JCenter is used to host the Kotlin coroutines libraries.
2016-08-06 14:40:14 +00:00
2019-02-12 21:58:28 +00:00
Then in your `mods.toml`:
```toml
modLoader="kotlinfml"
2019-02-12 21:58:28 +00:00
[[dependencies.your_mod_name]]
modId="forgelin"
mandatory=true
ordering="NONE"
side="BOTH"
# optionally, specify version range for Forgelin
```
Finally, replace `FMLModLoadingContext` references in your code with `FMLKotlinModLoadingContext`. For more info, check
out test sources [here](https://github.com/shadowfacts/Forgelin/tree/master/src/test/kotlin/net/shadowfacts/forgelin).