Jump to content

[1.14.3][Kotlin] Is repacking and shadowing the Kotlin runtime a bad idea?


Alex Sim

Recommended Posts

Hello everyone, I wanted to try making a mod using Kotlin, but Forgelin is completely trash: I couldn't get it to work on the latest Minecraft version.

 

Instead I opted to include the full Kotlin runtime in my Jar using johnregelman's shadow Gradle plugin (relocating it to com.my.package.embedded.kotlin so it doesn't conflict with any other mod doing the same thing)

 

I tried including it using the ContainedDeps manifest attribute (and yes, I put the Jars in META-INF/libraries), but it did not work, so this was my only option

Edited by Alex Sim
Link to comment
Share on other sites

  • 4 weeks later...
On 8/17/2019 at 10:52 PM, rdvdev2 said:

I found this Forgelin rewrite for 1.13.2+: https://www.curseforge.com/minecraft/mc-mods/kottle

It will hopefully do the trick 

Thank you, but I just don't see why a minecraft-version-dependant framework is needed when Kotlin actually does work out of the box, the only extra step needed is adding the @JvmStatic annotation alongside @SubscribeEvent in static event handler's methods

Link to comment
Share on other sites

I think this is a better approach because forge doesn't have the kotlin runtime or standard library. Without a language provider like kottle every mod would have to shadow these libraries, so it's a better practice to have one mod to carry this libraries to avoid redundancy. This also allows the kotlin libs to update independently 

Link to comment
Share on other sites

7 minutes ago, rdvdev2 said:

I think this is a better approach because forge doesn't have the kotlin runtime or standard library. Without a language provider like kottle every mod would have to shadow these libraries, so it's a better practice to have one mod to carry this libraries to avoid redundancy. This also allows the kotlin libs to update independently 

Yeah, but what I'm saying is this mod doesn't have to be minecraft-version dependant (but it currently is) so using it would mean I depend on it to be updated for updating my mod, while I don't have to worry about that if I shadow the Kotlin runtime

Edited by Alex Sim
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.