mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-01-08 17:07:38 +00:00
Override hashCode method in AbstractRegion
This commit fixes the PlotSquared issue where running a PlotSquared command could result in intense lag on the main thread. This was mainly seen with running the /p info command on an extremely large plot. Since #world can be null, the uniqueness of this hashCode is not the best, but since it's essentially just a collection of BlockVector3's, I don't believe this change will break anything. If it does, please let me know! Feedback on the uniqueness of this is welcomed.
This commit is contained in:
parent
058990f6fe
commit
8247f78e9d
@ -212,4 +212,12 @@ public abstract class AbstractRegion extends AbstractSet<BlockVector3> implement
|
||||
return chunks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int worldHash = this.world == null ? 7 : this.world.hashCode();
|
||||
int result = worldHash ^ (worldHash >>> 32);
|
||||
result = 31 * result + this.getMinimumPoint().hashCode();
|
||||
result = 31 * result + this.getMaximumPoint().hashCode();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user