LuckPerms

LuckPerms

41.4k Downloads

Using LuckPerms 5.4.25, Kotlin for Forge 3.3.2 and a mod written in Kotlin on Forge 40.1.25 leads to crash

3TUSK opened this issue ยท 4 comments

commented

Description

Launching dedicated server with the following environment leads to crash:

  • Forge 40.1.25
  • Kotlin for Forge 3.3.2
  • LuckPerms 5.4.25, the Forge build
  • A Forge mod written in Kotlin (and thus depends on Kotlin for Forge)

Reproduction Steps

  1. Assemble a dedicated server with the specified environment above. In my case, I built this mod on my own and uses that. Other mods depending on Kotlin for Forge may also trigger this, but I haven't tested them yet.
  2. Launch it using launch script provided by Forge.

Expected Behaviour

Server launches.

Server Details

Vanilla server with Forge 40.1.25 installed

LuckPerms Version

5.4.25

Logs and Configs

https://paste.feed-the-beast.com/view/d73b11be

Extra Details

I would also like to ask @thedarkcolour, author of Kotlin for Forge, for their comments on this issue.

My initial investigation shows that, this line

this.container = ModList.get().getModContainerByObject(this).orElse(null);

somehow prematurely triggers this
https://github.com/thedarkcolour/KotlinForForge/blob/c8b186c1c2629e46fd7ac1597543c321c4f340d7/src/main/kotlin/thedarkcolour/kotlinforforge/KotlinModContainer.kt#L88
because the ModList#getModContainerByObject has the following implementation

return mods.stream().filter(mc -> mc.getMod() == obj).findFirst();

My suggestion is to replace the call with

this.container = ModList.get().getModContainerById("luckperm").orElse(null);

Still, it is left to y'all to decide what is the best fix.

commented

I can change the LP code to avoid the problematic method, but I'd argue the problem is with the KotlinModContainer implementation, and not the LuckPerms usage.

commented

I can fix this on my side, no worries :)

commented

Should be fixed now, try with KFF 3.4.0

commented

Can confirm that thedarkcolour/KotlinForForge@515c655 solves the problem. Thank you both @lucko and @thedarkcolour!