Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible with Kotlin! #71

Open
ConcerroX opened this issue Mar 3, 2025 · 0 comments
Open

Not compatible with Kotlin! #71

ConcerroX opened this issue Mar 3, 2025 · 0 comments

Comments

@ConcerroX
Copy link

Environment:

  • Minecraft: 1.20.1
  • Forge: 47.1.43
  • Registrate: 1.3.3
  • Kotlin for Forge: 4.10.0

When initializing a Registrate in Kotlin, it throws an Exception since it invokes FMLJavaModLoadingContext.get() but Kotlin mod does not use FMLJavaModLoadingContext and its IEventBus. Please consider adding a custom IEventBus parameter.

Logs:

Exception message: java.lang.ClassCastException: class thedarkcolour.kotlinforforge.KotlinModLoadingContext cannot be cast to class net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext (thedarkcolour.kotlinforforge.KotlinModLoadingContext is in module [email protected] of loader 'LAYER PLUGIN' @402cdec9; net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext is in module [email protected] of loader 'LAYER PLUGIN' @402cdec9)
Stacktrace:
	at net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext.get(FMLJavaModLoadingContext.java:33) ~[javafmllanguage-1.20.1-47.1.43.jar%23200!/:?] {}
	at com.tterrag.registrate.AbstractRegistrate.getModEventBus(AbstractRegistrate.java:222) ~[Registrate-MC1.20-1.3.3.jar%23221!/:?] {re:classloading}
	at com.tterrag.registrate.Registrate.create(Registrate.java:15) ~[Registrate-MC1.20-1.3.3.jar%23221!/:?] {re:classloading}
	at concerrox.createmorecogwheels.CreateMoreCogwheelsKt$REGISTRATE$2.invoke(CreateMoreCogwheelsKt.java:21) ~[11779893590392133103.jar%23211!/:?] {re:classloading}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant