Added a few null pointer checks and performed minor touchups (tried improving a few equals, clone and hashCode methods).

This commit is contained in:
VictorD
2011-03-05 12:27:51 +01:00
parent 86344ad44e
commit cd490d826b
9 changed files with 51 additions and 16 deletions

View File

@@ -271,7 +271,19 @@ public class Location implements Cloneable {
@Override
public Location clone() {
return new Location(world, x, y, z, yaw, pitch);
try {
Location l = (Location)super.clone();
l.world = world;
l.x = x;
l.y = y;
l.z = z;
l.yaw = yaw;
l.pitch = pitch;
return l;
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return null;
}
/**