aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTechnus <daniel112092@gmail.com>2017-06-04 08:49:30 +0200
committerTechnus <daniel112092@gmail.com>2017-06-04 08:49:30 +0200
commit465b051c80ec4101e77a67c87c883485c273ff92 (patch)
treee5e1cb8927639e733846a2d5b3b7d1214c7bcd67 /src
parent17ad9da2fc885a783ea525a523c93d6d0d11fe49 (diff)
downloadGT5-Unofficial-465b051c80ec4101e77a67c87c883485c273ff92.tar.gz
GT5-Unofficial-465b051c80ec4101e77a67c87c883485c273ff92.tar.bz2
GT5-Unofficial-465b051c80ec4101e77a67c87c883485c273ff92.zip
Better compare
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/github/technus/tectech/vec3pos.java12
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