Skip to content

Update to support EventBus7 #129

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

Open
wants to merge 8 commits into
base: 5.x
Choose a base branch
from

Conversation

Chidoziealways
Copy link

Updated KotlinForForge to support MC 1.21.7 and the new EventBus7 introduced in Forge 57.x.
Mod containers now use BusGroup for event dispatching, keeping up with the Forge changes.

@thedarkcolour
Copy link
Owner

Do old Forge versions (1.21.1-1.21.5) use EB7? This could be a breaking change that I don't want to merge into KFF 6.x

@Chidoziealways
Copy link
Author

But, it also breaks support for MC 1.21.6-1.21.7
5.x and below can use EB6 but 6.x should use EB7

Copy link
Owner

@thedarkcolour thedarkcolour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll review the KotlinModContainer class later, I'm suspicious of the module reflection, but knowing LexForge, it's probably just how they decided to do it...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why all of these random Gradle options? If these changes are just for your setup, please remove them from the PR


min_mc_version = 1.20.6
unsupported_mc_version = 1.22

# KOTLIN FOR FORGE VERSION
kff_version=5.9.0
kff_max_version=6.0.0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be 7.0.0, not 6.1.0

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed that

@@ -132,9 +133,9 @@ public object AutoKotlinEventBusSubscriber {

private fun registerTo(any: Any, target: Mod.EventBusSubscriber.Bus, mod: KotlinModContainer) {
if (target == Mod.EventBusSubscriber.Bus.FORGE) {
target.bus().get().register(any)
target.bus().get()?.register(MethodHandles.lookup(), any)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the bus supplier now nullable? Should this log an error if the bus is null?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I use !! or ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compiler 2.2.0 won't let me go without !! or ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this change from the PR

@Chidoziealways
Copy link
Author

Is it ok now?

@Chidoziealways
Copy link
Author

Chidoziealways commented Jul 13, 2025 via email

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

Successfully merging this pull request may close these issues.

2 participants