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

Furhter abstraction of the Eventbus-DSL. #1

Closed
ChachyDev opened this issue Aug 1, 2021 · 2 comments · Fixed by #2
Closed

Furhter abstraction of the Eventbus-DSL. #1

ChachyDev opened this issue Aug 1, 2021 · 2 comments · Fixed by #2

Comments

@ChachyDev
Copy link
Owner

Currently, the Eventbus-DSL heavily relies on the Forge EventBus. Due to some mods using alternative event buses, for example, a popular choice is https://github.com/KevinPriv/KEventBus it would be easier to abstract the current DSL even further.

We could create an interface that the Forge EventBus and custom event buses can implement to call to register code.

Example:

interface EventBus {
  fun <T> register(event: Class<T>, action: T.() -> Unit) 
}
@isXander
Copy link

isXander commented Aug 1, 2021

How would the forge event bus implement this interface?

@ChachyDev
Copy link
Owner Author

In development, I ran into a few issues so I have reworked it. Once I test my code I will push it to a branch and you can explore how it would work after

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 a pull request may close this issue.

2 participants