geforkt von Mirrors/FastAsyncWorldEdit
Made Vector Comparable.
Dieser Commit ist enthalten in:
Ursprung
b32668057f
Commit
e69ad4d08f
@ -23,7 +23,7 @@ package com.sk89q.worldedit;
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class Vector {
|
||||
public class Vector implements Comparable<BlockVector> {
|
||||
protected final double x, y, z;
|
||||
|
||||
/**
|
||||
@ -691,6 +691,14 @@ public class Vector {
|
||||
return other.x == this.x && other.y == this.y && other.z == this.z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(BlockVector other) {
|
||||
if (y != other.y) return Double.compare(y, other.y);
|
||||
if (z != other.z) return Double.compare(z, other.z);
|
||||
if (x != other.x) return Double.compare(x, other.x);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the hash code.
|
||||
*
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren