KotlinLoader
Kotlin is a wonderful growing programming language with support for the JVM. This allows us to write Minecraft Plugins in Kotlin. While this works fine, it does bring some inconviences. To run kotlin, it is mandatory for the kotlin library files to be available at runtime. While it is possible to provide these classes with the -classpath option, when starting the JVM, most spigot servers run in managed environments. The go-to workaround for this problem is to add these library files to the final jar by shading them. This will increase your jar size alot.
KotlinLoader provides a custom PluginLoader, that will provide the Kotlin library classes for you.
Included Kotlin Libraries
- kotlin-stdlib
- kotlinx-coroutines
- kotlin-reflect
- kotlin-stdlib-jdk8
- kotlin-stdlib-jdk7
Pros
- Write Idiomatic Kotlin!
- The main class can be an object singleton, instead of a normal class.
- Decrease size of the final plugin jar.
- A simpler way of defining events, which prevent a lot of boilerplate.
Cons
- This plugin uses alot of reflection and injection hacks to allows Kotlin classes to be accessed by JavaPlugins
- Plugins extending KotlinPlugin should be located in the <server_root>/plugins/kotlin folder.
- Java Plugins might not be able to use features provided by Kotlin Plugins due to a problem in the normal PluginClassLoader
Roadmap
- Add support for .kts configuration
- Add support for annotation based/kts based plugin descriptions
- Add BungeeCord support
Usage for Server Administrators
Download the plugin and place it into your {server_root}/plugins folder.
Add the plugins using this project to the {server_root}/plugins/kotlin folder, which will be created on runtime, if it wasn't already.
For a slightly better description, please visit the github page.
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta