Added stuffs
This commit is contained in:
parent
76f4b5b0d9
commit
bf14e3ebb1
8 changed files with 276 additions and 27 deletions
41
src/main/java/WayofTime/alchemicalWizardry/api/Vector3.java
Normal file
41
src/main/java/WayofTime/alchemicalWizardry/api/Vector3.java
Normal file
|
@ -0,0 +1,41 @@
|
|||
package WayofTime.alchemicalWizardry.api;
|
||||
|
||||
public class Vector3
|
||||
{
|
||||
public int x, y, z;
|
||||
|
||||
public Vector3(int x, int y, int z)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public Vector3 add(Vector3 vec1)
|
||||
{
|
||||
return new Vector3(this.x + vec1.x, this.y + vec1.y, this.z + vec1.z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "V3(" + x + "}, " + y + "}," + z + "})";
|
||||
}
|
||||
|
||||
private boolean canEqual(Object object)
|
||||
{
|
||||
return object instanceof Vector3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object object)
|
||||
{
|
||||
return object == this ? true : (object instanceof Vector3 ? canEqual(this) && this.x == ((Vector3) object).x && this.y == ((Vector3) object).y && this.z == ((Vector3) object).z : false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return 48131 * x - 95021 * y + z;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue