diff --git a/src/main/java/com/sk89q/worldedit/Vector.java b/src/main/java/com/sk89q/worldedit/Vector.java index b1563e657..56cf29e4c 100644 --- a/src/main/java/com/sk89q/worldedit/Vector.java +++ b/src/main/java/com/sk89q/worldedit/Vector.java @@ -23,7 +23,7 @@ package com.sk89q.worldedit; * * @author sk89q */ -public class Vector { +public class Vector implements Comparable { 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. *