Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 50 lines 1.4 kB view raw
1package net.minecraft.server; 2 3public class ChunkCoordinates implements Comparable { 4 5 public int x; 6 public int y; 7 public int z; 8 9 public ChunkCoordinates() { 10 } 11 12 public ChunkCoordinates(int i, int j, int k) { 13 this.x = i; 14 this.y = j; 15 this.z = k; 16 } 17 18 public ChunkCoordinates(ChunkCoordinates chunkcoordinates) { 19 this.x = chunkcoordinates.x; 20 this.y = chunkcoordinates.y; 21 this.z = chunkcoordinates.z; 22 } 23 24 public boolean equals(Object object) { 25 if (!(object instanceof ChunkCoordinates)) { 26 return false; 27 } else { 28 ChunkCoordinates chunkcoordinates = (ChunkCoordinates) object; 29 30 return this.x == chunkcoordinates.x && this.y == chunkcoordinates.y && this.z == chunkcoordinates.z; 31 } 32 } 33 34 public int hashCode() { 35 return this.x + this.z << 8 + this.y << 16; 36 } 37 38 public int compareTo(Object o) { 39 ChunkCoordinates chunkcoordinates = (ChunkCoordinates) o; 40 return this.y == chunkcoordinates.y ? (this.z == chunkcoordinates.z ? this.x - chunkcoordinates.x : this.z - chunkcoordinates.z) : this.y - chunkcoordinates.y; 41 } 42 43 public double a(int i, int j, int k) { 44 int l = this.x - i; 45 int i1 = this.y - j; 46 int j1 = this.z - k; 47 48 return Math.sqrt((double) (l * l + i1 * i1 + j1 * j1)); 49 } 50}