mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-05 07:16:10 +00:00
add hashCode to Vector2Int
This commit is contained in:
@@ -2,6 +2,8 @@ package com.dfsek.terra.api.util.vector;
|
||||
|
||||
import com.dfsek.terra.api.util.Rotation;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* oh yeah
|
||||
@@ -82,4 +84,17 @@ public class Vector2Int {
|
||||
return new Vector2Int(x, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (31 * x) + z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if(obj instanceof Vector2Int that) {
|
||||
return this.x == that.x && this.z == that.z;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user