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

added WorldEvent listener to ForgeEventProcessor.kt #284

Merged

Conversation

minecraft-simon
Copy link
Contributor

Describe the pull
ForgeEventProcessor.kt will forward every WorldEvent and the respective subclass-events to the LambdaEventBus.
The listener for ChunkEvent.Unload must be removed since it extends WorldEvent and thus will be forwarded by its listener.

Describe how this pull is helpful
WorldEvent and its subclasses include a bunch of useful events like ChunkEvent, ChunkDataEvent, BlockEvent, NoteBlockEvent, GetCollisionBoxesEvent. Just adding the listener for WorldEvent instead of all subclasses individually saves a lot of code lines and works just as well with the listeners inside the modules (I tested that). I also made sure to check if there are any other listeners in the ForgeEventProcessor that might inherit from WorldEvent and thus would fire twice. But there are none except for ChunkEvent.Unload.
The reason I want to have this event on the bus is because I need to listen for WorldEvent, ChunkEvent and NoteBlockEvent for a plugin I am working on right now.

If you have any questions, please feel free to contact me here or on Discord: Simon#4530
Thank you very much!

@huddy987
Copy link
Contributor

This makes sense to me, lets just make sure CI passes first before merging

@minecraft-simon
Copy link
Contributor Author

@huddy987 The CI has passed, correct? Is there anything else needed before merging?

@huddy987
Copy link
Contributor

Thanks for your contribution

@huddy987 huddy987 merged commit aa5c6f9 into lambda-client:master Mar 28, 2022
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