PlotSquared/src/main/java/com/intellectualcrafters/plot/object/ChunkLoc.java

34 lines
730 B
Java
Raw Normal View History

2014-12-28 13:02:30 +01:00
package com.intellectualcrafters.plot.object;
2015-09-11 12:09:22 +02:00
public class ChunkLoc
{
2014-12-28 13:02:30 +01:00
public int x;
public int z;
2015-02-23 02:32:27 +01:00
2015-09-11 12:09:22 +02: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
2015-09-11 12:09:22 +02:00
public int hashCode()
{
2014-12-28 13:02:30 +01:00
final int prime = 31;
int result = 1;
2015-09-11 12:09:22 +02:00
result = (prime * result) + x;
result = (prime * result) + z;
2014-12-28 13:02:30 +01:00
return result;
}
2015-02-23 02:32:27 +01:00
2014-12-28 13:02:30 +01:00
@Override
2015-09-11 12:09:22 +02:00
public boolean equals(final Object obj)
{
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;
2015-09-11 12:09:22 +02:00
return ((x == other.x) && (z == other.z));
2014-12-28 13:02:30 +01:00
}
}