mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-12 02:36:18 +00:00
Fix Location clone issue
This commit is contained in:
@@ -4,8 +4,8 @@ import com.dfsek.terra.api.generic.world.World;
|
||||
import com.dfsek.terra.api.generic.world.block.Block;
|
||||
|
||||
public class Location implements Cloneable {
|
||||
private final World world;
|
||||
private final Vector3 vector;
|
||||
private World world;
|
||||
private Vector3 vector;
|
||||
|
||||
public Location(World w, double x, double y, double z) {
|
||||
this.world = w;
|
||||
@@ -17,10 +17,24 @@ public class Location implements Cloneable {
|
||||
this.vector = vector;
|
||||
}
|
||||
|
||||
public void setWorld(World world) {
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
public Vector3 getVector() {
|
||||
return vector;
|
||||
}
|
||||
|
||||
public void setVector(Vector3 vector) {
|
||||
this.vector = vector;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location clone() {
|
||||
try {
|
||||
return (Location) super.clone();
|
||||
Location other = (Location) super.clone();
|
||||
other.setVector(other.getVector().clone());
|
||||
return other;
|
||||
} catch(CloneNotSupportedException e) {
|
||||
throw new Error(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user