This project is a Kotlin language adapter for Minecraft Forge mod development. It also includes some convenience functions and classes.
It is totally possible to not use Boxlin while developing Kotlin mods for Minecraft. But it can turn your code to a better structure.
@Mod(
modid = Mod.ID,
name = Mod.NAME,
version = Mod.VERSION
)
class Mod {
companion object {
const val ID = "mod"
const val NAME = "Mod"
const val VERSION = "1.0.0"
}
@EventHandler
fun preInit(event: FMLPreInitializationEvent) {
// code...
}
}
@Mod(
modid = Mod.ID,
name = Mod.NAME,
version = Mod.VERSION,
modLanguage = "Kotlin",
modLanguageAdapter = Boxlin.ADAPTER
)
object Mod {
const val ID = "mod"
const val NAME = "Mod"
const val VERSION = "1.0.0"
@EventHandler
fun preInit(event: FMLPreInitializationEvent) {
// code...
}
}
Make sure that in the repositories closure the jcenter
is called:
repositories {
jcenter()
// ...
}
And then paste this in the dependencies closure compile "io.opencubes.boxlin:boxlin:1.3.0"
.