Closed ejektaflex closed 5 years ago
For anyone else viewing this:
as a workaround for now, please use either of other available methods to register event listeners:
.register(ListenerObject)
.addListener { event: RegistryEvent.Register<Item> -> ListenerObject.registerItems(event) }
@KotlinEventBusSubscriber
Finally had time to have my hands on that.
In short the answer is that it's not Kottle's fault. Forge internally uses https://github.com/jhalterman/typetools to auto-resolve type of event to register. Consumer
is passed into that (most likely kotlin's compiler's wrapper for that method call), which breaks everything.
There's nothing that can be done about it, unfortunately. This Forge's internal magic only properly works with Java (as it should).
I'll add it to the docs.
It seems that trying to listen for this event does not work. Forge 28.0.14 Kottle 1.1.0
My code is:
The specific error is:
Failed to resolve handler for "ejektaflex.bountiful.BountifulMod$sam$i$java_util_function_Consumer$0@53a3ffcc"
caused byFailed to resolve consumer event type: ejektaflex.bountiful.BountifulMod$sam$i$java_util_function_Consumer$0@53a3ffcc
It seems to be this specific line, it might be what is returning null
Error log: https://gist.github.com/ejektaflex/96d80d6ece525a91fac82f6a91c95040