make Vector3 constructor private

This commit is contained in:
dfsek
2021-12-20 00:06:35 -07:00
parent 007c761537
commit fb6c86801e
7 changed files with 8 additions and 8 deletions

View File

@@ -49,7 +49,7 @@ public class StateFunction implements Function<Void> {
z.apply(implementationArguments, variableMap).doubleValue());
RotationUtil.rotateVector(xz, arguments.getRotation());
Vector3 origin = new Vector3(FastMath.roundToInt(xz.getX()), y.apply(implementationArguments, variableMap).intValue(),
Vector3 origin = Vector3.of(FastMath.roundToInt(xz.getX()), y.apply(implementationArguments, variableMap).intValue(),
FastMath.roundToInt(xz.getZ())).add(arguments.getOrigin());
try {
BlockEntity state = arguments.getWorld().getBlockEntity(origin);

View File

@@ -51,7 +51,7 @@ public class CheckFunction implements Function<String> {
RotationUtil.rotateVector(xz, arguments.getRotation());
Vector3 location = arguments.getOrigin().toVector3().clone().add(
new Vector3(FastMath.roundToInt(xz.getX()), y.apply(implementationArguments, variableMap).doubleValue(),
Vector3.of(FastMath.roundToInt(xz.getX()), y.apply(implementationArguments, variableMap).doubleValue(),
FastMath.roundToInt(xz.getZ())));
return apply(location, arguments.getWorld());

View File

@@ -135,7 +135,7 @@ public class Vector2 implements Cloneable {
}
public Vector3 extrude(double y) {
return new Vector3(this.x, y, this.z);
return Vector3.of(this.x, y, this.z);
}
public Vector2 add(double x, double z) {

View File

@@ -20,7 +20,7 @@ public class Vector3 implements Cloneable {
private double y;
private double z;
public Vector3(double x, double y, double z) {
private Vector3(double x, double y, double z) {
this.x = x;
this.y = y;
this.z = z;