Vector and BlockVector should use the same hashCode

For example, the getChunks method returns a Set<Vector2D> which is
actually comprised of BlockVector2D, so using set.contains(some vector)
will always return false.

There's unlikely to be multiple entities on the same block, or above
y=256, so using the int coords is better.
This commit is contained in:
Jesse Boyd
2017-01-10 16:03:10 +11:00
parent 9f24f84c2b
commit ad7fdd19fb
4 changed files with 2 additions and 21 deletions

View File

@ -84,13 +84,6 @@ public class BlockVector extends Vector {
}
@Override
public int hashCode() {
return ((int) x << 19) ^
((int) y << 12) ^
(int) z;
}
@Override
public BlockVector toBlockVector() {
return this;