Spotlin - Provides the Kotlin runtime for other plugins

This is a discussion topic for the Ore project, Spotlin. View the full project on Ore for downloads and more information.


A Sponge plugin providing the Kotlin runtime, standard library,
and reflection library to other plugins.

Note: The plugin in itself does not provide anything other than the Kotlin Runtime libraries. For it to be actually useful, plugin developers need to depend on this plugin. If no plugin depends on this, you can safely remove the plugin.


Licensed under the MIT License.

Depending on Spotlin - Build System

Follow the instructions below to depend on kotlin.

Depending on Spotlin - Plugin Manifest

In order to make sure your plugin both requires and loads after Spotlin, add this to your @Plugin annotation:

@[Plugin(dependencies = arrayOf(Dependency(id = "spotlin", 
                                           optional = false, 
                                           version = "0.1.3")))]
class PluginClass

If you do not have the kapt plugin enabled, you will also need to add this to your file:

    "requiredMods": [
        "[email protected]"
1 Like

A new version has been released for Spotlin, it is available for download here.

Fixes the plugin manifest version. No changes to the Kotlin libraries were made


I thought you said that you were going to shade this with versioning, so that people could use multiple versions if plugins required?

Since you are not relocating the standard library, it is only possible to have one runtime/std-lib loaded? This could lead to incompatibility issues if plugin A needs another version than plugin B.

Right now that I am on my computer, let me address those questions:

I initially started out with that, however after some discussion with @pie_flavor it was decided that we will not relocate the libraries.

Suppose we relocate the current version 1.1.3’s kotlin to spotlin.v1_1, when kotlin 1.2.0 comes out, we will have to migrate to spotlin.v1_2, which instantly becomes a breaking change, something I don’t want. It also limits us to only allow such updates to the latest breaking Sponge API releases.

As far as I have seen, Kotlin has followed SemVer, with a few exceptions here and there. As such the same rule of breakage follows as does for SpongeAPI. If you use 6.1.x APIs and try to run a plugin on a 6.0.x, we will have a malfunctioning plugin. Similar rule applies for this plugin. Any plugin depending on 0.1.0 of spotlin should be able to run on 0.2.0.

Overall remember that the plugin is new, and I am open to discussion. If any such issues are rising, I want to squash them before a 1.0 release

(Edit): @pie_flavor you want to anything here aswell?

That’s the idea, so someone using plugins that have dependencies on both could have Spotlin11 and Spolin12 running side by side, until the plugin that is lagging catches up.

I don’t see how? Also given that Sponge Forge can load libraries from the mods directory, and Sponge Vanilla should (if it doesn’t file an issue) expose similar functionality, that unless you do shade or relocate, Spotlin is pretty much un-needed?

It doesn’t, and given that it’s Forge functionality, not Sponge’s, I doubt it should be a priority. And the reason a plugin is important is that it mandates a specific version of the library on a specific version of the API. If a developer could simply say “I need this library, stick it in the mods dir pl0x”, then there is literally no difference from shading without relocation - works great for the single plugin, but if another plugin depends on the same library but in an incompatible version, then there’s problems. If the unrelocated library is controlled at one set of compatible versions, then there are no version conflicts.

Meanwhile, unless I’m missing something, there’s no way to compile against a package that was relocated externally without acknowledging the relocation in your code, and the compiler will have problems with that. And then it becomes a plugin written for Spotlin, not for Kotlin.

1 Like

Ok, I see how it should work. And I think it will work that way.
Correct me if I’m wrong: The goal of this idea is to only have the Kotlin library once in the mods folder to save space(the lib is something like 1MB in the jar)?

Two things: Saving space isn’t that much needed considering much larger mods(pixelmon, half GB) and several enourmously big worlds(plenty of GB). And, earlier when I started releasing Kotlin plugins, I also thought about just instructing the admin to put the kotlin libs in the mods folder. I feared that some admins don’t want the hassle, so I put the lib in the plugin itself(first without relocating, then with relocating).

Well, it’s a nonzero amount of space that’s being saved, and it doesn’t hurt anything.

Ok, but I’ll continue shading and relocating the lib, it’s a comfort I can provide the admins easily.

I will get a couple releases today or tomorrow: one for 6.0.0, one for 6.1.0-SNAPSHOT and perhaps one for 7.0.0-SNAPSHOT. The target kotlin will be 1.1.50

A new version has been released for Spotlin, it is available for download here.

Update to Kotlin 1.1.50. Changelog for kotlin can be found here

Hi everyone,

Firstly apologies on never touching this since October last year. I just hadn’t gotten time to get to this. I am looking for someone who can take over this.

I have moved mostly away from everything Minecraft and probably will never will come back to this. At the same time, I dont want this amazing name for kotlin support to go to waste.

If you are interested in taking over, get in touch with me here or on the github for the project.

– KingGoesGaming

Pls update the Plugin to the newest Kotlin Version (1.2.61)

And update to the newest SpongeAPI (stable) Version (7.0.0)

@pie_flavor ^^^^^^

I really want the API 7 release to be Kotlin 1.3 - that’s why I haven’t yet.

A new version has been released for Spotlin, it is available for download here.

@pie_flavor has taken over the project (sans the ore release management, which is waiting on project transfer feature implementation). For issues and other queries, have fun poking him :smiley:

It’s been a while since this plugin was updated but finally we have a new version: 0.2.0 :slightly_smiling_face:.


  • Update to kotlin v1.3.0