mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-02 02:47:11 +00:00
Made Vector Comparable.
This commit is contained in:
parent
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.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user