A tribute to Jesse
This commit is contained in:
MattBDev
2019-09-20 21:52:35 -04:00
parent 68c8fca672
commit 8b96cdc9a5
121 changed files with 1196 additions and 1130 deletions

View File

@ -98,7 +98,6 @@ public abstract class BlockVector3 {
// thread-safe initialization idiom
private static final class YzxOrderComparator {
private static final Comparator<BlockVector3> YZX_ORDER =
Comparator.comparingInt(BlockVector3::getY)
.thenComparingInt(BlockVector3::getZ)
@ -151,38 +150,6 @@ public abstract class BlockVector3 {
return BlockVector3.at(getX(), getY(), getZ());
}
// /**
// * Get the BlockVector3 to the north<br>
// * Normal use you would use north(this),
// * To avoid constructing a new Vector, pass e.g. north(some MutableBlockVector3)
// * There is no gaurantee it will use this provided vector
// * @param orDefault the vector to use as the result<br>
// * @return BlockVector3
// */
// public BlockVector3 north(BlockVector3 orDefault) {
// return orDefault.setComponents(getX(), getY(), getZ() - 1);
// }
//
// public BlockVector3 east(BlockVector3 orDefault) {
// return orDefault.setComponents(getX() + 1, getY(), getZ());
// }
//
// public BlockVector3 south(BlockVector3 orDefault) {
// return orDefault.setComponents(getX(), getY(), getZ() + 1);
// }
//
// public BlockVector3 west(BlockVector3 orDefault) {
// return orDefault.setComponents(getX() - 1, getY(), getZ());
// }
//
// public BlockVector3 up(BlockVector3 orDefault) {
// return orDefault.setComponents(getX(), getY() + 1, getZ());
// }
//
// public BlockVector3 down(BlockVector3 orDefault) {
// return orDefault.setComponents(getX(), getY() - 1, getZ());
// }
public long toLongPackedForm() {
checkLongPackable(this);
return (getX() & BITS_26) | ((getZ() & BITS_26) << 26) | (((getY() & (long) BITS_12) << (26 + 26)));
@ -289,7 +256,8 @@ public abstract class BlockVector3 {
}
/**
* Add a list of vectors to this vector and return the result as a new vector.
* Add a list of vectors to this vector and return the
* result as a new vector.
*
* @param others an array of vectors
* @return a new vector
@ -307,7 +275,8 @@ public abstract class BlockVector3 {
}
/**
* Subtract another vector from this vector and return the result as a new vector.
* Subtract another vector from this vector and return the result
* as a new vector.
*
* @param other the other vector
* @return a new vector
@ -317,7 +286,8 @@ public abstract class BlockVector3 {
}
/**
* Subtract another vector from this vector and return the result as a new vector.
* Subtract another vector from this vector and return the result
* as a new vector.
*
* @param x the value to subtract
* @param y the value to subtract
@ -329,7 +299,8 @@ public abstract class BlockVector3 {
}
/**
* Subtract a list of vectors from this vector and return the result as a new vector.
* Subtract a list of vectors from this vector and return the result
* as a new vector.
*
* @param others an array of vectors
* @return a new vector
@ -514,7 +485,8 @@ public abstract class BlockVector3 {
}
/**
* Get the normalized vector, which is the vector divided by its length, as a new vector.
* Get the normalized vector, which is the vector divided by its
* length, as a new vector.
*
* @return a new vector
*/
@ -613,7 +585,8 @@ public abstract class BlockVector3 {
}
/**
* Returns a vector with the absolute values of the components of this vector.
* Returns a vector with the absolute values of the components of
* this vector.
*
* @return a new vector
*/
@ -624,16 +597,15 @@ public abstract class BlockVector3 {
/**
* Perform a 2D transformation on this vector and return a new one.
*
* @param angle in degrees
* @param aboutX about which x coordinate to rotate
* @param aboutZ about which z coordinate to rotate
* @param angle in degrees
* @param aboutX about which x coordinate to rotate
* @param aboutZ about which z coordinate to rotate
* @param translateX what to add after rotation
* @param translateZ what to add after rotation
* @return a new vector
* @see AffineTransform another method to transform vectors
*/
public BlockVector3 transform2D(double angle, double aboutX, double aboutZ, double translateX,
double translateZ) {
public BlockVector3 transform2D(double angle, double aboutX, double aboutZ, double translateX, double translateZ) {
angle = Math.toRadians(angle);
double x = this.getX() - aboutX;
double z = this.getZ() - aboutZ;
@ -691,9 +663,9 @@ public abstract class BlockVector3 {
*/
public BlockVector3 getMinimum(BlockVector3 v2) {
return new BlockVector3Imp(
Math.min(getX(), v2.getX()),
Math.min(getY(), v2.getY()),
Math.min(getZ(), v2.getZ())
Math.min(getX(), v2.getX()),
Math.min(getY(), v2.getY()),
Math.min(getZ(), v2.getZ())
);
}
@ -705,9 +677,9 @@ public abstract class BlockVector3 {
*/
public BlockVector3 getMaximum(BlockVector3 v2) {
return new BlockVector3Imp(
Math.max(getX(), v2.getX()),
Math.max(getY(), v2.getY()),
Math.max(getZ(), v2.getZ())
Math.max(getX(), v2.getX()),
Math.max(getY(), v2.getY()),
Math.max(getZ(), v2.getZ())
);
}
@ -788,7 +760,8 @@ public abstract class BlockVector3 {
return false;
}
return equals((BlockVector3) obj);
BlockVector3 other = (BlockVector3) obj;
return other.getX() == this.getX() && other.getY() == this.getY() && other.getZ() == this.getZ();
}
public final boolean equals(BlockVector3 other) {

View File

@ -31,8 +31,8 @@ import java.util.List;
/**
* A Kochanek-Bartels interpolation; continuous in the 2nd derivative.
*
* <p>Supports Node#tension tension, Node#bias bias and
* Node#continuity continuity parameters per {@link Node}.</p>
* <p>Supports {@link Node#tension tension}, {@link Node#bias bias} and
* {@link Node#continuity continuity} parameters per {@link Node}.</p>
*/
public class KochanekBartelsInterpolation implements Interpolation {