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

[1.21.1-Neoforge] EventBusSubscriber Annotation doesn't work on Java class #110

Open
alegian opened this issue Nov 29, 2024 · 2 comments
Open

Comments

@alegian
Copy link

alegian commented Nov 29, 2024

I want to integrate KFF into a large codebase incrementally. I was happy to see that the @Mod annotation works for my main Java mod class, even when using KFF loader.

I expected the @EventBusSubscriber annotation to do the same on my events class (uses static methods), but it doesn't. It doesn't even complain, Neo just crashes because of unregistered stuff. Switching my event class to Kotlin object immediately solved it.

I don't know how KFF works, so I dont know if this is feasible, but it should definitely be documented somewhere. I spent hours debugging it, since there is no visible KFF error. The skeleton projects have no dedicated event file example.

To be clear, the issue is: Following the steps in README for an existing mod, the resulting setup may sometimes crash, due to events not being loaded.

@thedarkcolour
Copy link
Owner

This is the code where @EventBusSubscriber classes are loaded. I'll add documentation for where exactly EventBusSubscriber is applicable (since you can even use it as a file: annotation)

@alegian
Copy link
Author

alegian commented Nov 29, 2024

thank you :)

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

2 participants