Flipped a Table
Replaced several core classes from DD with new classes to enforce integrity checks. Rewriting everything that depended on those classes is a massive undertaking but it should simplify our code and prevent the many bugs we've seen lately. The rewrite isn't done yet, just committing my progress so far.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package StevenDimDoors.mod_pocketDim.util;
|
||||
|
||||
|
||||
public final class Point4D
|
||||
public final class Point4D implements Comparable<Point4D>
|
||||
{
|
||||
private final int x;
|
||||
private final int y;
|
||||
@@ -135,6 +135,21 @@ public final class Point4D
|
||||
return (x == other.x && y == other.y && z == other.z && dimension == other.dimension);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Point4D other)
|
||||
{
|
||||
int diff = x - other.x;
|
||||
if (diff != 0)
|
||||
return diff;
|
||||
diff = y - other.y;
|
||||
if (diff != 0)
|
||||
return diff;
|
||||
diff = z - other.z;
|
||||
if (diff != 0)
|
||||
return diff;
|
||||
return dimension - other.dimension;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user