Skip to content

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


# 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

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

@Chidoziealways
Copy link
Author

I'm not yet done with the update. Still testing and making changes

@Chidoziealways
Copy link
Author

Currently fighting with EventBusSubscriber firing too late for our likings

@thedarkcolour
Copy link
Owner

I can also take a look at it after I'm back from work.

@Chidoziealways
Copy link
Author

As of now, all Events to be automatically registered need to be @SubscriveEvent and @JvmStatic

…scribers. ADDED ACTUAL EVENT FIRING AND MANY MORE
@Chidoziealways
Copy link
Author

Ok. Done with the PR. DOne with the commits, done with the updating. All that's left is for you to merge. Everything WOrks perfectly fine

@Chidoziealways
Copy link
Author

Or can I upload to curseforge?? and modrinth?? PLS

@Chidoziealways
Copy link
Author

Right Now, All EventBusSubscriber classes have to use KotlinEventBusSubscriber, all Mod KotlinMod all Bus KotlinBus and the @subscribe methods should NOT have @JvmStatic

@Chidoziealways
Copy link
Author

until you publish the changes to curseforge I'll embed them

@thedarkcolour
Copy link
Owner

Gonna look this over in a few hours.

@Chidoziealways
Copy link
Author

um, did you forget about this?

@thedarkcolour
Copy link
Owner

Sorry, I have not had time. I'm not ignoring it though

Copy link
Owner

Choose a reason for hiding this comment

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

Why are we now using @KotlinMod instead of @mod?

Copy link
Author

Choose a reason for hiding this comment

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

To make it easier to distinguish, because the @mod annotation is part of the FML Loader, and it would be easier for KFF to have it's own annotation, as it's a separate loader.

Copy link
Owner

Choose a reason for hiding this comment

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

No emojis in the log messages. This is not an AI-generated mod.

}

private companion object {
private val MOD_ANNOTATION = Type.getType("Lnet/minecraftforge/fml/common/Mod;")
Copy link
Owner

Choose a reason for hiding this comment

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

Again, what's up with the separate annotation?

@thedarkcolour
Copy link
Owner

I will give this a more careful review sooner, I have yet to test this in-game.

@Chidoziealways
Copy link
Author

are those really conflicts? or should I not change the versions? Latest Kotlin is 2.2.20

@Chidoziealways
Copy link
Author

and then, 1.21.9 is out so I need to update again, so new version is 6.1.0?

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