mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-23 08:38:51 +00:00
make Vector3 constructor private
This commit is contained in:
@@ -49,7 +49,7 @@ public class StateFunction implements Function<Void> {
|
|||||||
z.apply(implementationArguments, variableMap).doubleValue());
|
z.apply(implementationArguments, variableMap).doubleValue());
|
||||||
RotationUtil.rotateVector(xz, arguments.getRotation());
|
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());
|
FastMath.roundToInt(xz.getZ())).add(arguments.getOrigin());
|
||||||
try {
|
try {
|
||||||
BlockEntity state = arguments.getWorld().getBlockEntity(origin);
|
BlockEntity state = arguments.getWorld().getBlockEntity(origin);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class CheckFunction implements Function<String> {
|
|||||||
RotationUtil.rotateVector(xz, arguments.getRotation());
|
RotationUtil.rotateVector(xz, arguments.getRotation());
|
||||||
|
|
||||||
Vector3 location = arguments.getOrigin().toVector3().clone().add(
|
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())));
|
FastMath.roundToInt(xz.getZ())));
|
||||||
|
|
||||||
return apply(location, arguments.getWorld());
|
return apply(location, arguments.getWorld());
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ public class Vector2 implements Cloneable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Vector3 extrude(double y) {
|
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) {
|
public Vector2 add(double x, double z) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class Vector3 implements Cloneable {
|
|||||||
private double y;
|
private double y;
|
||||||
private double z;
|
private double z;
|
||||||
|
|
||||||
public Vector3(double x, double y, double z) {
|
private Vector3(double x, double y, double z) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
this.z = z;
|
this.z = z;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class BukkitPlayer extends BukkitCommandSender implements Player {
|
|||||||
@Override
|
@Override
|
||||||
public Vector3 position() {
|
public Vector3 position() {
|
||||||
org.bukkit.Location bukkit = delegate.getLocation();
|
org.bukkit.Location bukkit = delegate.getLocation();
|
||||||
return new Vector3(bukkit.getX(), bukkit.getY(), bukkit.getZ());
|
return Vector3.of(bukkit.getX(), bukkit.getY(), bukkit.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ public final class BukkitAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Vector3 adapt(Location location) {
|
public static Vector3 adapt(Location location) {
|
||||||
return new Vector3(location.getX(), location.getY(), location.getZ());
|
return Vector3.of(location.getX(), location.getY(), location.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Vector adapt(Vector3 vector3) {
|
public static Vector adapt(Vector3 vector3) {
|
||||||
@@ -160,7 +160,7 @@ public final class BukkitAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Vector3 adapt(Vector vector) {
|
public static Vector3 adapt(Vector vector) {
|
||||||
return new Vector3(vector.getX(), vector.getY(), vector.getZ());
|
return Vector3.of(vector.getX(), vector.getY(), vector.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CommandSender adapt(org.bukkit.command.CommandSender sender) {
|
public static CommandSender adapt(org.bukkit.command.CommandSender sender) {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public final class FabricAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Vector3 adapt(BlockPos pos) {
|
public static Vector3 adapt(BlockPos pos) {
|
||||||
return new Vector3(pos.getX(), pos.getY(), pos.getZ());
|
return Vector3.of(pos.getX(), pos.getY(), pos.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FabricBlockState adapt(BlockState state) {
|
public static FabricBlockState adapt(BlockState state) {
|
||||||
|
|||||||
Reference in New Issue
Block a user