Skip to content

Comments

Fix incorrect event handler registration#1520

Merged
TechLord22 merged 1 commit intoGregTechCEu:masterfrom
Tictim:event_handler_fix
Feb 21, 2023
Merged

Fix incorrect event handler registration#1520
TechLord22 merged 1 commit intoGregTechCEu:masterfrom
Tictim:event_handler_fix

Conversation

@Tictim
Copy link
Contributor

@Tictim Tictim commented Feb 20, 2023

What

This PR fixes a part of event handler registration broken in a recent commit. Additionally, this PR removes one unnecessary registration.

Outcome

worldgen.addLoot option and worldgen.increaseDungeonLoot option, which broke due to the incorrect event handler registration, will work again.

Additional Information

I've looked into every occurrence of MinecraftForge.EVENT_BUS.register on the project and deemed there was no further issues. At least on surface level.

@ALongStringOfNumbers ALongStringOfNumbers added the type: bug Something isn't working label Feb 21, 2023
@ALongStringOfNumbers
Copy link
Contributor

The chest gen hooks issue was probably because Tech made the subscribeEvent static in his probable bugs PR. Does simply making the SubscribeEvent not static fix the issue?

@Tictim
Copy link
Contributor Author

Tictim commented Feb 21, 2023

I chose to modify the registration method and keep the event handler static because there was no usage of ChestGenHooks instance anywhere except on event registration. In fact the event handler being nonstatic were probably how IDEA complained about it in the first place. Keeping the event handler static should be enough to prevent same mistake happening in future.

@TechLord22 TechLord22 merged commit bffc816 into GregTechCEu:master Feb 21, 2023
@Tictim Tictim deleted the event_handler_fix branch February 21, 2023 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants