mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
@ -83,16 +83,31 @@ public abstract class Vector3 {
|
||||
return YzxOrderComparator.YZX_ORDER;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the x coordinate rounded, accounting for negative coordinates
|
||||
*
|
||||
* @return the x coordinate
|
||||
*/
|
||||
public int getBlockX() {
|
||||
return (int) MathUtils.roundHalfUp(getX());
|
||||
return MathMan.roundInt(getX());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the y coordinate rounded, accounting for negative coordinates
|
||||
*
|
||||
* @return the y coordinate
|
||||
*/
|
||||
public int getBlockY() {
|
||||
return (int) MathUtils.roundHalfUp(getY());
|
||||
return MathMan.roundInt(getY());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the z coordinate rounded, accounting for negative coordinates
|
||||
*
|
||||
* @return the z coordinate
|
||||
*/
|
||||
public int getBlockZ() {
|
||||
return (int) MathUtils.roundHalfUp(getZ());
|
||||
return MathMan.roundInt(getZ());
|
||||
}
|
||||
|
||||
public MutableVector3 setComponents(Vector3 other) {
|
||||
@ -487,6 +502,15 @@ public abstract class Vector3 {
|
||||
return Vector3.at(Math.floor(getX() + 0.5), Math.floor(getY() + 0.5), Math.floor(getZ() + 0.5));
|
||||
}
|
||||
|
||||
/**
|
||||
* Rounds all components using {@link MathUtils#roundHalfUp(double)}
|
||||
*
|
||||
* @return a new vector
|
||||
*/
|
||||
public Vector3 roundHalfUp() {
|
||||
return Vector3.at(MathUtils.roundHalfUp(getX()), MathUtils.roundHalfUp(getY()), MathUtils.roundHalfUp(getZ()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a vector with the absolute values of the components of
|
||||
* this vector.
|
||||
@ -595,8 +619,7 @@ public abstract class Vector3 {
|
||||
* @return a new {@code BlockVector}
|
||||
*/
|
||||
public static BlockVector3 toBlockPoint(double x, double y, double z) {
|
||||
return BlockVector3.at(MathUtils.roundHalfUp(x), MathUtils.roundHalfUp(y), MathUtils.roundHalfUp(z));
|
||||
//return BlockVector3.at(x, y, z);
|
||||
return BlockVector3.at(x, y, z);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
package com.sk89q.worldedit.util;
|
||||
|
||||
import com.boydti.fawe.util.MathMan;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
|
||||
@ -80,8 +79,7 @@ public enum Direction {
|
||||
}
|
||||
|
||||
Direction(Vector3 vector, int flags, int left, int right) {
|
||||
this.blockPoint = BlockVector3.at(MathMan.roundInt(Math.signum(vector.getX())),
|
||||
MathMan.roundInt(Math.signum(vector.getY())), MathMan.roundInt(Math.signum(vector.getZ())));
|
||||
this.blockPoint = BlockVector3.at(Math.signum(vector.getX()), Math.signum(vector.getY()), Math.signum(vector.getZ()));
|
||||
this.direction = vector.normalize();
|
||||
this.flags = flags;
|
||||
this.left = left;
|
||||
|
Reference in New Issue
Block a user