-
-
Notifications
You must be signed in to change notification settings - Fork 884
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
[API] Add equality checks to all "Region" implementations #2673
Comments
You say "sorting collections" which implies you want them to implement As for My current feeling is that since we have no use-case for it, we should not implement it at this time. But I'm open to discussion on it. |
I was facing the issue of Map and Collection #contains returning false even if the region was inside the map or list in my opinion, a simple comparison of the positions and region class is enough as for the |
There are issues with ignoring the World (technically incorrect, depending on what you're trying to do with the regions). It's possibly you may be better off using a |
In most cases if you want to compare regions you also want the worlds to be compared |
WorldEdit barely uses the world. I think in the actual WE implementation itself, the World is only ever used for clamping bounds. Thus your idea of "most cases" is going to be entirely up to where you're getting those region objects and what you're using them for. |
The Problem
Currently, when comparing regions or putting them into a HashMap or sorting collections or basically anything that requires consistent equals and hashCode result
A Solution
Proper equals and hashCode methods for comparison of regions
Alternatives
Writing your own wrappers to add equals and hashCode methods
Anything Else?
No response
The text was updated successfully, but these errors were encountered: