-
Notifications
You must be signed in to change notification settings - Fork 15
Protocol rewamp from A-Z #44
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
base: v5
Are you sure you want to change the base?
Protocol rewamp from A-Z #44
Conversation
| @PreInitialize | ||
| public void preInit() { | ||
| ComponentRegistry.registerComponentHolder(ComponentHolder.builder() | ||
| .type(PacketListener.class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PacketListener sounds cool, but what about using the built-in event bus system to deploy packet events?
Simply create an event class, annotated as @Event and use EventBus.call() to deploy the event.
Check here:
https://github.com/FairyProject/fairy/tree/v5/io.fairyproject.platforms/core-platform/src/main/java/io/fairyproject/event
https://github.com/FairyProject/fairy/blob/v5/io.fairyproject.platforms/mc-platform/src/main/java/io/fairyproject/mc/event/MCPlayerJoinEvent.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd be missing out on the pre-done wrappers being injected as a direct parameter, which honestly would save a lot of time from doing wrapper.getPacket() then casting etc...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, then it should be cool to have both I guess?
Uh oh!
There was an error while loading. Please reload this page.