2014-12-28 13:02:30 +01:00
|
|
|
package com.intellectualcrafters.plot.object;
|
|
|
|
|
|
|
|
public class ChunkLoc {
|
|
|
|
public int x;
|
|
|
|
public int z;
|
2015-02-23 02:32:27 +01:00
|
|
|
|
2015-02-20 07:34:19 +01:00
|
|
|
public ChunkLoc(final int x, final int z) {
|
2014-12-28 13:02:30 +01:00
|
|
|
this.x = x;
|
|
|
|
this.z = z;
|
|
|
|
}
|
2015-02-23 02:32:27 +01:00
|
|
|
|
2014-12-28 13:02:30 +01:00
|
|
|
@Override
|
|
|
|
public int hashCode() {
|
|
|
|
final int prime = 31;
|
|
|
|
int result = 1;
|
|
|
|
result = (prime * result) + this.x;
|
|
|
|
result = (prime * result) + this.z;
|
|
|
|
return result;
|
|
|
|
}
|
2015-02-23 02:32:27 +01:00
|
|
|
|
2014-12-28 13:02:30 +01:00
|
|
|
@Override
|
2015-02-20 07:34:19 +01:00
|
|
|
public boolean equals(final Object obj) {
|
2014-12-28 13:02:30 +01:00
|
|
|
if (this == obj) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (obj == null) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (getClass() != obj.getClass()) {
|
|
|
|
return false;
|
|
|
|
}
|
2015-02-20 07:34:19 +01:00
|
|
|
final ChunkLoc other = (ChunkLoc) obj;
|
2014-12-28 13:02:30 +01:00
|
|
|
return ((this.x == other.x) && (this.z == other.z));
|
|
|
|
}
|
|
|
|
}
|