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

ClientEventSubscriber is subscribed on both sides #2

Closed
V0idWa1k3r opened this issue Nov 3, 2018 · 0 comments
Closed

ClientEventSubscriber is subscribed on both sides #2

V0idWa1k3r opened this issue Nov 3, 2018 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@V0idWa1k3r
Copy link

V0idWa1k3r commented Nov 3, 2018

When using the @Mod.EventBusSubscriber it subscribes the class to the bus on both sides. You can however specify the side it is subscribed on using the value property of the annotation(example). Without specifying it the class will be subscribed on both sides which may lead to issues. While ClientEventSubscriber in your case doesn't load any client-only classes when loaded it gives modmakers a false impression that it will only be loaded on the client(because of the name). They may then decide to expose client-only classes in it(by making their methods return/take them as parameters, or by specifying fields of those types) and thus crashing the server. I recommend you specify the side in your EventBusSubscriber annotation to avoid those issues.
Edit: The same appies to the ServerEventSubscriber class actually.

@Cadiboo Cadiboo added the bug Something isn't working label Nov 12, 2018
@Cadiboo Cadiboo self-assigned this Nov 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants