mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-08-30 13:50:46 +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;
|
import com.dfsek.terra.api.generic.world.block.Block;
|
||||||
|
|
||||||
public class Location implements Cloneable {
|
public class Location implements Cloneable {
|
||||||
private final World world;
|
private World world;
|
||||||
private final Vector3 vector;
|
private Vector3 vector;
|
||||||
|
|
||||||
public Location(World w, double x, double y, double z) {
|
public Location(World w, double x, double y, double z) {
|
||||||
this.world = w;
|
this.world = w;
|
||||||
@@ -17,10 +17,24 @@ public class Location implements Cloneable {
|
|||||||
this.vector = vector;
|
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
|
@Override
|
||||||
public Location clone() {
|
public Location clone() {
|
||||||
try {
|
try {
|
||||||
return (Location) super.clone();
|
Location other = (Location) super.clone();
|
||||||
|
other.setVector(other.getVector().clone());
|
||||||
|
return other;
|
||||||
} catch(CloneNotSupportedException e) {
|
} catch(CloneNotSupportedException e) {
|
||||||
throw new Error(e);
|
throw new Error(e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user