mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-24 18:09:41 -05:00
Added a few null pointer checks and performed minor touchups (tried improving a few equals, clone and hashCode methods).
By: VictorD <victor.danell@gmail.com>
This commit is contained in:
1 parent
5673661da0
commit
bb755bb9a2
9 files changed
+51
-16
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user