diff options
author | Technus <daniel112092@gmail.com> | 2017-06-04 08:49:30 +0200 |
---|---|---|
committer | Technus <daniel112092@gmail.com> | 2017-06-04 08:49:30 +0200 |
commit | 465b051c80ec4101e77a67c87c883485c273ff92 (patch) | |
tree | e5e1cb8927639e733846a2d5b3b7d1214c7bcd67 /src/main/java | |
parent | 17ad9da2fc885a783ea525a523c93d6d0d11fe49 (diff) | |
download | GT5-Unofficial-465b051c80ec4101e77a67c87c883485c273ff92.tar.gz GT5-Unofficial-465b051c80ec4101e77a67c87c883485c273ff92.tar.bz2 GT5-Unofficial-465b051c80ec4101e77a67c87c883485c273ff92.zip |
Better compare
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/github/technus/tectech/vec3pos.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/main/java/com/github/technus/tectech/vec3pos.java b/src/main/java/com/github/technus/tectech/vec3pos.java index 2de982ea95..1a4a38f142 100644 --- a/src/main/java/com/github/technus/tectech/vec3pos.java +++ b/src/main/java/com/github/technus/tectech/vec3pos.java @@ -23,13 +23,11 @@ public class vec3pos implements Comparable<vec3pos> { @Override public int compareTo(vec3pos o) { - if (y > o.y) return 1; - if (y < o.y) return -1; - if (x > o.x) return 1; - if (x < o.x) return -1; - if (z > o.z) return 1; - if (z < o.z) return -1; - return 0; + int tmp=y-o.y; + if (tmp!=0) return tmp; + tmp=x-o.x; + if (tmp!=0) return tmp; + return z-o.z; } @Override |