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

Events have not good implementations of equals(), hashCode() and toString() #719

Open
Janmm14 opened this issue Jan 22, 2021 · 0 comments
Open

Comments

@Janmm14
Copy link
Contributor

Janmm14 commented Jan 22, 2021

Many events have neither of the three and a toString() call is for example handled by PlayerEvent class, which prints PlayerEvent and not the actual event subclass. Additionally CancellablePlayerEvent and InventoryTransactionEvent as examples are ignoring fields from its super class in its toString().

I suggest removing custom equals and hashCode implementations from events as there is no reason to save and compare event instances.

Also toString() methods should be updated and added to all events to include super class fields like player or entity and cancelled.

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

No branches or pull requests

1 participant