-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
Backend: Custom event bus #2008
Backend: Custom event bus #2008
Conversation
src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt
Show resolved
Hide resolved
Can we get this as a explicit functionally since we have some events that need that behavior. Eg: GuiRenderEvent, MobEvent, WorldClickEvent |
Never mind, we can just get similar behavior with generics and type aliases |
The explicit way is to subscribe to the events individually, I dont think its beneficial in anyway to let it try to post its super types.
|
And yes you can also do that |
This pull request has conflicts with the base branch "beta". Please resolve those so we can test out your changes. |
# Conflicts: # src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
Conflicts have been resolved! 🎉 |
This pull request has conflicts with the base branch "beta". Please resolve those so we can test out your changes. |
# Conflicts: # src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt # src/main/java/at/hannibal2/skyhanni/features/fishing/FishingHookDisplay.kt
Conflicts have been resolved! 🎉 |
…ork/backend/event-bus
Dependencies
What
This adds a fully custom loader independent event bus, this includes several optimizations for SkyHanni specifically such as to early escape the invoker loop if no other invokers can receive cancel, this also includes things such as proper generic events, checks for if on skyblock or a skyblock island, custom event priority using a number instead of an enum with optional constants matching the forge event priorities.
It also provides a way for the repo to remotely disable a specific event and method an event is handled on.
In addition to the additions above unlike forges event bus the cancellable events use a interface as to not put people under the wrong assumption of a cancel being allowed on an event even though its not cancellable.
Important
For performance benefits this only supports events on a single class
ie. if EventA extends EventB but EventA is posted EventB wont also be posted.
Note
As of right now I have just changed 1 single event to the new event bus to show off its capabilities, all future events should be switched to this event bus and following PR(s) will switch the existing ones.
Changelog Technical Details