Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

Posted

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

  • 4 weeks later...
  • Author
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

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 

  • Author
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

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.