-
Notifications
You must be signed in to change notification settings - Fork 7
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
Event bus wip stuff #32
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… module class to have it populated with its instance, allowing for easy singleton patterns. This is opt in
…ed to create more than 1, just waste of resources when its contents are always the same
refactored ZetaMod. split hacky remap code into its own class
I did enough testing and stuff seems to work. I'll merge. Feel free to have a look later incase some further changes need to be done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR main goal is to get rid of zeta own dedicated bus implementation and instead delegate everything to the forge bus directly.
This should ideally cut of on some overhead of the previous impl where each event would get fired by forge, picked up by zeta, wrapped and re sent through zeta own event system.
To do so ive added an (arguably terribly hacky) class whose main purpose is to wrap and unwrap Zeta events automatically turning into Forge events.
Wrapper class must either:
these classes must be registered to that ForgeToZetaRemapper class that each ForgeZetaEvent has an instance of.
I made said class a singleton to try to cut back on reflections overhead. Might want to be looked at.
Each zeta event, be either of a "forge event" type of a new custom zeta event must have one of these class in the forge package for it to work properly as the mod needs to convert those common defined events into one that implements Event.
If only Event was an interface all this remapping bs wouldnt be that complicated. Might be worth researching into ways to inject it onto zeta events classes using ASM black magic.
To make this possible many minor refactors were also made, as well as some other stuff that i stumbled across.
Some things are removal of Phase enum, giving all tick events a Phase subclass, adding all needed wrapper event classes and turning some common events into interfaces, changing color registration code a bit, moved some from load to play bus to match whats on forge
I might write here more later