com/hypixel/hytale/math/Axis.java
package com.hypixel.hytale.math;
import com.hypixel.hytale.math.vector.Vector3d;
import com.hypixel.hytale.math.vector.Vector3f;
import com.hypixel.hytale.math.vector.Vector3i;
import javax.annotation.Nonnull;
public enum Axis {
X(new Vector3i (1 , 0 , 0 )),
Y(new Vector3i (0 , 1 , 0 )),
Z(new Vector3i (0 , 0 , 1 ));
private final Vector3i direction;
private Axis (@Nonnull final Vector3i direction) {
this .direction = direction;
}
@Nonnull
public Vector3i getDirection () {
return this .direction.clone();
}
public void rotate (@Nonnull Vector3i vector, int angle) {
if (angle < 0 ) {
angle = Math.floorMod(angle, 360 );
}
for (int i = angle; i > 0 ; i -= 90 ) {
this .rotate(vector);
}
}
public void rotate (@Nonnull Vector3d vector, int angle) {
if (angle < 0 ) {
angle = Math.floorMod(angle, 360 );
}
for (int i = angle; i > 0 ; i -= 90 ) {
this .rotate(vector);
}
}
public void rotate (@Nonnull Vector3i vector) {
switch (this .ordinal()) {
case 0 -> vector.assign(vector.getX(), -vector.getZ(), vector.getY());
case 1 -> vector.assign(vector.getZ(), vector.getY(), -vector.getX());
case 2 -> vector.assign(-vector.getY(), vector.getX(), vector.getZ());
}
}
public void rotate (@Nonnull Vector3d vector) {
switch (this .ordinal()) {
case 0 -> vector.assign(vector.getX(), -vector.getZ(), vector.getY());
case 1 -> vector.assign(vector.getZ(), vector.getY(), -vector.getX());
case 2 -> vector.assign(-vector.getY(), vector.getX(), vector.getZ());
}
}
public void flip (@Nonnull Vector3i vector) {
switch (this .ordinal()) {
case 0 -> vector.assign(-vector.getX(), vector.getY(), vector.getZ());
case 1 -> vector.assign(vector.getX(), -vector.getY(), vector.getZ());
case 2 -> vector.assign(vector.getX(), vector.getY(), -vector.getZ());
}
}
public void flip (@Nonnull Vector3d vector) {
switch (this .ordinal()) {
case 0 -> vector.assign(-vector.getX(), vector.getY(), vector.getZ());
case 1 -> vector.assign(vector.getX(), -vector.getY(), vector.getZ());
case 2 -> vector.assign(vector.getX(), vector.getY(), -vector.getZ());
}
}
public void flipRotation (@Nonnull Vector3f rotation) {
switch (this .ordinal()) {
case 0 -> rotation.setYaw(-rotation.getYaw());
case 1 -> rotation.setPitch(-rotation.getPitch());
case 2 -> rotation.setYaw(3.1415927F - rotation.getYaw());
}
}
}
com/hypixel/hytale/math/Mat4f.java
package com.hypixel.hytale.math;
import io.netty.buffer.ByteBuf;
import javax.annotation.Nonnull;
public class Mat4f {
public static final int SIZE = 64 ;
public final float m11;
public final float m12;
public final float m13;
public final float m14;
public final float m21;
public final float m22;
public final float m23;
public final float m24;
public final float m31;
public final float m32;
public final float m33;
public final float m34;
public final float m41;
public m42;
m43;
m44;
{
.m11 = m11;
.m12 = m12;
.m13 = m13;
.m14 = m14;
.m21 = m21;
.m22 = m22;
.m23 = m23;
.m24 = m24;
.m31 = m31;
.m32 = m32;
.m33 = m33;
.m34 = m34;
.m41 = m41;
.m42 = m42;
.m43 = m43;
.m44 = m44;
}
Mat4f {
( , , , , , , , , , , , , , , , );
}
Mat4f {
(Float.intBitsToFloat(buf.getIntLE(offset)), Float.intBitsToFloat(buf.getIntLE(offset + )), Float.intBitsToFloat(buf.getIntLE(offset + )), Float.intBitsToFloat(buf.getIntLE(offset + )), Float.intBitsToFloat(buf.getIntLE(offset + )), Float.intBitsToFloat(buf.getIntLE(offset + )), Float.intBitsToFloat(buf.getIntLE(offset + )), Float.intBitsToFloat(buf.getIntLE(offset + )), Float.intBitsToFloat(buf.getIntLE(offset + )), Float.intBitsToFloat(buf.getIntLE(offset + )), Float.intBitsToFloat(buf.getIntLE(offset + )), Float.intBitsToFloat(buf.getIntLE(offset + )), Float.intBitsToFloat(buf.getIntLE(offset + )), Float.intBitsToFloat(buf.getIntLE(offset + )), Float.intBitsToFloat(buf.getIntLE(offset + )), Float.intBitsToFloat(buf.getIntLE(offset + )));
}
{
buf.writeIntLE(Float.floatToRawIntBits( .m11));
buf.writeIntLE(Float.floatToRawIntBits( .m12));
buf.writeIntLE(Float.floatToRawIntBits( .m13));
buf.writeIntLE(Float.floatToRawIntBits( .m14));
buf.writeIntLE(Float.floatToRawIntBits( .m21));
buf.writeIntLE(Float.floatToRawIntBits( .m22));
buf.writeIntLE(Float.floatToRawIntBits( .m23));
buf.writeIntLE(Float.floatToRawIntBits( .m24));
buf.writeIntLE(Float.floatToRawIntBits( .m31));
buf.writeIntLE(Float.floatToRawIntBits( .m32));
buf.writeIntLE(Float.floatToRawIntBits( .m33));
buf.writeIntLE(Float.floatToRawIntBits( .m34));
buf.writeIntLE(Float.floatToRawIntBits( .m41));
buf.writeIntLE(Float.floatToRawIntBits( .m42));
buf.writeIntLE(Float.floatToRawIntBits( .m43));
buf.writeIntLE(Float.floatToRawIntBits( .m44));
}
}
com/hypixel/hytale/math/Quatf.java
package com.hypixel.hytale.math;
import io.netty.buffer.ByteBuf;
import javax.annotation.Nonnull;
public class Quatf {
public static final int SIZE = 16 ;
public final float x;
public final float y;
public final float z;
public final float w;
public Quatf (float x, float y, float z, float w) {
this .x = x;
this .y = y;
this .z = z;
this .w = w;
}
@Nonnull
public static Quatf deserialize (@Nonnull ByteBuf buf, int offset) {
return new Quatf (Float.intBitsToFloat(buf.getIntLE(offset)), Float.intBitsToFloat(buf.getIntLE(offset + 4 )), Float.intBitsToFloat(buf.getIntLE(offset + 8 )), Float.intBitsToFloat(buf.getIntLE(offset + 12 )));
}
{
buf.writeIntLE(Float.floatToRawIntBits( .x));
buf.writeIntLE(Float.floatToRawIntBits( .y));
buf.writeIntLE(Float.floatToRawIntBits( .z));
buf.writeIntLE(Float.floatToRawIntBits( .w));
}
}
com/hypixel/hytale/math/Range.java
package com.hypixel.hytale.math;
import javax.annotation.Nonnull;
public class Range {
private float min;
private float max;
public Range () {
}
public Range (float min, float max) {
this .min = min;
this .max = max;
}
public float getMin () {
return this .min;
}
public float getMax () {
return this .max;
}
@Nonnull
public String toString () {
return "Range{min=" + this .min + ", max='" + this .max + "'}" ;
}
}
com/hypixel/hytale/math/Vec2f.java
package com.hypixel.hytale.math;
import io.netty.buffer.ByteBuf;
import javax.annotation.Nonnull;
public final class Vec2f {
public static final int SIZE = 8 ;
public float x;
public float y;
public Vec2f (float x, float y) {
this .x = x;
this .y = y;
}
public Vec2f () {
}
@Nonnull
public static Vec2f deserialize (@Nonnull ByteBuf buf, int offset) {
return new Vec2f (Float.intBitsToFloat(buf.getIntLE(offset)), Float.intBitsToFloat(buf.getIntLE(offset + 4 )));
}
public void serialize (@Nonnull ByteBuf buf) {
buf.writeIntLE(Float.floatToRawIntBits(this .x));
buf.writeIntLE(Float.floatToRawIntBits(this .y));
}
public String toString {
+ .x + + .y + ;
}
}
com/hypixel/hytale/math/Vec3f.java
package com.hypixel.hytale.math;
import io.netty.buffer.ByteBuf;
import javax.annotation.Nonnull;
public final class Vec3f {
public static final int SIZE = 12 ;
public float x;
public float y;
public float z;
public Vec3f (float x, float y, float z) {
this .x = x;
this .y = y;
this .z = z;
}
public Vec3f () {
}
@Nonnull
public static Vec3f deserialize (@Nonnull ByteBuf buf, int offset) {
return new Vec3f (Float.intBitsToFloat(buf.getIntLE(offset)), Float.intBitsToFloat(buf.getIntLE(offset + 4 )), Float.intBitsToFloat(buf.getIntLE(offset + 8 )));
}
public void serialize (@Nonnull ByteBuf buf) {
buf.writeIntLE(Float.floatToRawIntBits( .x));
buf.writeIntLE(Float.floatToRawIntBits( .y));
buf.writeIntLE(Float.floatToRawIntBits( .z));
}
String {
+ .x + + .y + + .z + ;
}
}
com/hypixel/hytale/math/Vec4f.java
package com.hypixel.hytale.math;
import io.netty.buffer.ByteBuf;
import javax.annotation.Nonnull;
public class Vec4f {
public static final int SIZE = 16 ;
public final float x;
public final float y;
public final float z;
public final float w;
public Vec4f (float x, float y, float z, float w) {
this .x = x;
this .y = y;
this .z = z;
this .w = w;
}
@Nonnull
public static Vec4f deserialize (@Nonnull ByteBuf buf, int offset) {
return new Vec4f (Float.intBitsToFloat(buf.getIntLE(offset)), Float.intBitsToFloat(buf.getIntLE(offset + 4 )), Float.intBitsToFloat(buf.getIntLE(offset + 8 )), Float.intBitsToFloat(buf.getIntLE(offset + 12 )));
}
{
buf.writeIntLE(Float.floatToRawIntBits( .x));
buf.writeIntLE(Float.floatToRawIntBits( .y));
buf.writeIntLE(Float.floatToRawIntBits( .z));
buf.writeIntLE(Float.floatToRawIntBits( .w));
}
}
com/hypixel/hytale/math/block/BlockConeUtil.java
package com.hypixel.hytale.math.block;
import com.hypixel.hytale.function.predicate.TriIntObjPredicate;
import javax.annotation.Nonnull;
public class BlockConeUtil {
public BlockConeUtil () {
}
public static <T> void forEachBlock (int originX, int originY, int originZ, int radiusX, int height, int radiusZ, T t, @Nonnull TriIntObjPredicate<T> consumer) {
if (radiusX <= 0 ) {
throw new IllegalArgumentException (String.valueOf(radiusX));
} else if (height <= 0 ) {
throw new IllegalArgumentException (String.valueOf(height));
} else if (radiusZ <= 0 ) {
throw new IllegalArgumentException (String.valueOf(radiusZ));
} else {
float radiusXAdjusted = (float )radiusX + 0.41F ;
float radiusZAdjusted = ( )radiusZ + ;
( height - ; y >= ; --y) {
- ( )y / ( )height;
( )radiusXAdjusted * rf;
maxX;
-(maxX = ( )dx);
( minX; x <= maxX; ++x) {
- ( )(x * x) / (dx * dx);
Math.sqrt(qx) * ( )radiusZAdjusted * rf;
maxZ;
-(maxZ = ( )dz);
( minZ; z <= maxZ; ++z) {
(!consumer.test(originX + x, originY + y, originZ + z, t)) {
;
}
}
}
}
}
}
<T> {
forEachBlock(originX, originY, originZ, radiusX, height, radiusZ, thickness, , t, consumer);
}
<T> {
(thickness < ) {
forEachBlock(originX, originY, originZ, radiusX, height, radiusZ, t, consumer);
} (radiusX <= ) {
(String.valueOf(radiusX));
} (height <= ) {
(String.valueOf(height));
} (radiusZ <= ) {
(String.valueOf(radiusZ));
} {
( )radiusX + ;
( height - ; y >= ; --y) {
capped && y < thickness;
- ( )y / ( )height;
( )radiusXAdjusted * rf;
/ (dx * dx);
dx > ( )thickness ? dx - ( )thickness : ;
innerDx > ? / (innerDx * innerDx) : ;
maxX;
-(maxX = ( )dx);
( minX; x <= maxX; ++x) {
Math.sqrt( - ( )(x * x) * dxInvSqr) * dx;
maxZ;
-(maxZ = ( )dz);
cap ? : Math.sqrt( - ( )(x * x) * innerDxInvSqr) * innerDx;
cap ? : -innerMaxZ;
( minZ; z <= maxZ; ++z) {
((!(( )z > innerMinZ) || !(( )z < innerMaxZ)) && !consumer.test(originX + x, originY + y, originZ + z, t)) {
;
}
}
}
}
}
}
<T> {
(radiusX <= ) {
(String.valueOf(radiusX));
} (height <= ) {
(String.valueOf(height));
} (radiusZ <= ) {
(String.valueOf(radiusZ));
} {
( )radiusX + ;
( )radiusZ + ;
( height - ; y >= ; --y) {
- ( )y / ( )height;
( )radiusXAdjusted * rf;
maxX;
-(maxX = ( )dx);
( minX; x <= maxX; ++x) {
- ( )(x * x) / (dx * dx);
Math.sqrt(qx) * ( )radiusZAdjusted * rf;
maxZ;
-(maxZ = ( )dz);
( minZ; z <= maxZ; ++z) {
(!consumer.test(originX + x, originY + height - - y, originZ + z, t)) {
;
}
}
}
}
}
}
<T> {
forEachBlock(originX, originY, originZ, radiusX, height, radiusZ, thickness, , t, consumer);
}
<T> {
(thickness < ) {
forEachBlockInverted(originX, originY, originZ, radiusX, height, radiusZ, t, consumer);
} (radiusX <= ) {
(String.valueOf(radiusX));
} (height <= ) {
(String.valueOf(height));
} (radiusZ <= ) {
(String.valueOf(radiusZ));
} {
( )radiusX + ;
( height - ; y >= ; --y) {
capped && y < thickness;
- ( )y / ( )height;
( )radiusXAdjusted * rf;
/ (dx * dx);
dx > ( )thickness ? dx - ( )thickness : ;
innerDx > ? / (innerDx * innerDx) : ;
maxX;
-(maxX = ( )dx);
( minX; x <= maxX; ++x) {
Math.sqrt( - ( )(x * x) * dxInvSqr) * dx;
maxZ;
-(maxZ = ( )dz);
cap ? : Math.sqrt( - ( )(x * x) * innerDxInvSqr) * innerDx;
cap ? : -innerMaxZ;
( minZ; z <= maxZ; ++z) {
((!(( )z > innerMinZ) || !(( )z < innerMaxZ)) && !consumer.test(originX + x, originY + height - - y, originZ + z, t)) {
;
}
}
}
}
}
}
}
com/hypixel/hytale/math/block/BlockCubeUtil.java
package com.hypixel.hytale.math.block;
import com.hypixel.hytale.function.predicate.TriIntObjPredicate;
import com.hypixel.hytale.math.vector.Vector3i;
import javax.annotation.Nonnull;
public class BlockCubeUtil {
public BlockCubeUtil () {
}
public static <T> boolean forEachBlock (int originX, int originY, int originZ, int radiusX, int height, int radiusZ, T t, @Nonnull TriIntObjPredicate<T> consumer) {
int radiusY = height / 2 ;
for (int dx = -radiusX; dx <= radiusX; ++dx) {
for (int dz = -radiusZ; dz <= radiusZ; ++dz) {
for (int dy = -radiusY; dy <= radiusY; ++dy) {
if (!consumer.test(originX + dx, originY + dy, originZ + dz, t)) {
return false ;
}
}
}
}
return true ;
}
public static <T> boolean {
forEachBlock(originX, originY, originZ, radiusX, height, radiusZ, thickness, , t, consumer);
}
<T> {
forEachBlock(originX, originY, originZ, radiusX, height, radiusZ, thickness, capped, capped, , t, consumer);
}
<T> {
(thickness < ) {
forEachBlock(originX, originY, originZ, radiusX, height, radiusZ, t, consumer);
} {
height / ;
-radiusX + thickness;
radiusX - thickness;
-radiusZ + thickness;
radiusZ - thickness;
cappedBottom ? -radiusY + thickness : -height;
cappedTop ? radiusY - thickness : height;
( -radiusX; dx <= radiusX; ++dx) {
( -radiusZ; dz <= radiusZ; ++dz) {
( -radiusY; dy <= radiusY; ++dy) {
(dy >= innerMinY && dy <= innerMaxY && dx >= innerMinX && dx <= innerMaxX && dz >= innerMinZ && dz <= innerMaxZ) {
(hollow && !consumer.test(originX + dx, originY + dy, originZ + dz, t)) {
;
}
} (!consumer.test(originX + dx, originY + dy, originZ + dz, t)) {
;
}
}
}
}
;
}
}
<T> {
Vector3i.min(pointOne, pointTwo);
Vector3i.max(pointOne, pointTwo);
( min.x; x <= max.x; ++x) {
( min.z; z <= max.z; ++z) {
( min.y; y <= max.y; ++y) {
(!consumer.test(x, y, z, t)) {
;
}
}
}
}
;
}
<T> {
(thickness < ) {
forEachBlock(pointOne, pointTwo, t, consumer);
} {
Vector3i.min(pointOne, pointTwo);
Vector3i.max(pointOne, pointTwo);
min.x + thickness;
max.x - thickness;
min.z + thickness;
max.z - thickness;
cappedBottom ? min.y + thickness : min.y;
cappedTop ? max.y - thickness : max.y;
( min.x; x <= max.x; ++x) {
( min.z; z <= max.z; ++z) {
( min.y; y <= max.y; ++y) {
(hollow) {
(y >= innerMinY && y <= innerMaxY && x >= innerMinX && x <= innerMaxX && z >= innerMinZ && z <= innerMaxZ && !consumer.test(x, y, z, t)) {
;
}
} ((y < innerMinY || y > innerMaxY || x < innerMinX || x > innerMaxX || z < innerMinZ || z > innerMaxZ) && !consumer.test(x, y, z, t)) {
;
}
}
}
}
;
}
}
}
com/hypixel/hytale/math/block/BlockCylinderUtil.java
package com.hypixel.hytale.math.block;
import com.hypixel.hytale.function.predicate.TriIntObjPredicate;
import com.hypixel.hytale.math.util.MathUtil;
import javax.annotation.Nonnull;
public class BlockCylinderUtil {
public BlockCylinderUtil () {
}
public static <T> boolean forEachBlock (int originX, int originY, int originZ, int radiusX, int height, int radiusZ, T t, @Nonnull TriIntObjPredicate<T> consumer) {
if (radiusX <= 0 ) {
throw new IllegalArgumentException (String.valueOf(radiusX));
} else if (height <= 0 ) {
throw new IllegalArgumentException (String.valueOf(height));
} else if (radiusZ <= 0 ) {
throw new IllegalArgumentException (String.valueOf(radiusZ));
} else {
float radiusXAdjusted = (float )radiusX + 0.41F ;
float ( )radiusZ + ;
/ ( )(radiusXAdjusted * radiusXAdjusted);
( -radiusX; x <= radiusX; ++x) {
- ( )(x * x) * invRadiusXSqr;
Math.sqrt(qx) * ( )radiusZAdjusted;
maxZ;
-(maxZ = ( )dz);
( minZ; z <= maxZ; ++z) {
( height - ; y >= ; --y) {
(!consumer.test(originX + x, originY + y, originZ + z, t)) {
;
}
}
}
}
;
}
}
<T> {
forEachBlock(originX, originY, originZ, radiusX, height, radiusZ, thickness, , t, consumer);
}
<T> {
(thickness < ) {
forEachBlock(originX, originY, originZ, radiusX, height, radiusZ, t, consumer);
} (radiusX <= ) {
(String.valueOf(radiusX));
} (height <= ) {
(String.valueOf(height));
} (radiusZ <= ) {
(String.valueOf(radiusZ));
} {
( )radiusX + ;
( )radiusZ + ;
radiusXAdjusted - ( )thickness;
radiusZAdjusted - ( )thickness;
(!(innerRadiusXAdjusted <= ) && !(innerRadiusZAdjusted <= )) {
/ ( )(radiusXAdjusted * radiusXAdjusted);
/ ( )(innerRadiusXAdjusted * innerRadiusXAdjusted);
thickness;
height - thickness;
( height - ; y >= ; --y) {
capped && (y < innerMinY || y > innerMaxY);
( -radiusX; x <= radiusX; ++x) {
- ( )(x * x) * invRadiusXSqr;
Math.sqrt(qx) * ( )radiusZAdjusted;
( )dz;
( )x < innerRadiusXAdjusted ? - ( )(x * x) * invInnerRadiusXSqr : ;
innerQx > ? Math.sqrt(innerQx) * ( )innerRadiusZAdjusted : ;
cap ? : MathUtil.ceil(innerDZ);
minZ;
(minZ == ) {
(!consumer.test(originX + x, originY + y, originZ, t)) {
;
}
z = minZ + ;
}
(z <= maxZ) {
(!consumer.test(originX + x, originY + y, originZ + z, t)) {
;
}
(!consumer.test(originX + x, originY + y, originZ - z, t)) {
;
}
++z;
}
}
}
;
} {
forEachBlock(originX, originY, originZ, radiusX, height, radiusZ, t, consumer);
}
}
}
}
com/hypixel/hytale/math/block/BlockDiamondUtil.java
package com.hypixel.hytale.math.block;
import com.hypixel.hytale.function.predicate.TriIntObjPredicate;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class BlockDiamondUtil {
public BlockDiamondUtil () {
}
public static <T> boolean forEachBlock (int originX, int originY, int originZ, int radiusX, int radiusY, int radiusZ, @Nullable T t, @Nonnull TriIntObjPredicate<T> consumer) {
if (radiusX <= 0 ) {
throw new IllegalArgumentException (String.valueOf(radiusX));
} else if (radiusY <= 0 ) {
throw new IllegalArgumentException (String.valueOf(radiusY));
} else if (radiusZ <= 0 ) {
throw new IllegalArgumentException (String.valueOf(radiusZ));
} else {
float radiusXAdjusted = (float )radiusX + 0.41F ;
( )radiusZ + ;
( ; y <= radiusY; ++y) {
( )y / ( )radiusY;
radiusXAdjusted * ( - normalizedY);
radiusZAdjusted * ( - normalizedY);
( )currentRadiusX;
( )currentRadiusZ;
( ; x <= maxX; ++x) {
( ; z <= maxZ; ++z) {
(( )Math.abs(x) <= currentRadiusX && ( )Math.abs(z) <= currentRadiusZ && !test(originX, originY, originZ, x, y, z, t, consumer)) {
;
}
}
}
}
;
}
}
<T> {
(thickness < ) {
forEachBlock(originX, originY, originZ, radiusX, radiusY, radiusZ, t, consumer);
} (radiusX <= ) {
(String.valueOf(radiusX));
} (radiusY <= ) {
(String.valueOf(radiusY));
} (radiusZ <= ) {
(String.valueOf(radiusZ));
} {
( )radiusX + ;
( )radiusZ + ;
( ; y <= radiusY; ++y) {
( )y / ( )radiusY;
radiusXAdjusted * ( - normalizedY);
radiusZAdjusted * ( - normalizedY);
Math.max( , currentRadiusX - ( )thickness);
Math.max( , currentRadiusZ - ( )thickness);
( )currentRadiusX;
( )currentRadiusZ;
( ; x <= maxX; ++x) {
( ; z <= maxZ; ++z) {
( )Math.abs(x) <= currentRadiusX && ( )Math.abs(z) <= currentRadiusZ;
(inOuter) {
( )Math.abs(x) < innerRadiusX && ( )Math.abs(z) < innerRadiusZ;
(!inInner && !test(originX, originY, originZ, x, y, z, t, consumer)) {
;
}
}
}
}
}
;
}
}
<T> {
(!consumer.test(originX + x, originY + y, originZ + z, context)) {
;
} (y > && !consumer.test(originX + x, originY - y, originZ + z, context)) {
;
} {
(x > ) {
(!consumer.test(originX - x, originY + y, originZ + z, context)) {
;
}
(y > && !consumer.test(originX - x, originY - y, originZ + z, context)) {
;
}
(z > && !consumer.test(originX - x, originY + y, originZ - z, context)) {
;
}
(y > && z > && !consumer.test(originX - x, originY - y, originZ - z, context)) {
;
}
}
(z > ) {
(!consumer.test(originX + x, originY + y, originZ - z, context)) {
;
}
(y > && !consumer.test(originX + x, originY - y, originZ - z, context)) {
;
}
}
;
}
}
}
com/hypixel/hytale/math/block/BlockDomeUtil.java
package com.hypixel.hytale.math.block;
import com.hypixel.hytale.function.predicate.TriIntObjPredicate;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class BlockDomeUtil {
public BlockDomeUtil () {
}
public static <T> boolean forEachBlock (int originX, int originY, int originZ, int radiusX, int radiusY, int radiusZ, @Nullable T t, @Nonnull TriIntObjPredicate<T> consumer) {
if (radiusX <= 0 ) {
throw new IllegalArgumentException (String.valueOf(radiusX));
} else if (radiusY <= 0 ) {
throw new IllegalArgumentException (String.valueOf(radiusY));
} else if (radiusZ <= 0 ) {
throw new IllegalArgumentException (String.valueOf(radiusZ));
} else {
float radiusXAdjusted = (float )radiusX + 0.41F ;
float ( )radiusY + ;
( )radiusZ + ;
/ (radiusXAdjusted * radiusXAdjusted);
/ (radiusYAdjusted * radiusYAdjusted);
( ; x <= radiusX; ++x) {
- ( )(x * x) * invRadiusXSqr;
Math.sqrt(( )qx) * ( )radiusYAdjusted;
( )dy;
( ; y <= maxY; ++y) {
Math.sqrt(( )(qx - ( )(y * y) * invRadiusYSqr)) * ( )radiusZAdjusted;
( )dz;
( ; z <= maxZ; ++z) {
(!test(originX, originY, originZ, x, y, z, t, consumer)) {
;
}
}
}
}
;
}
}
<T> {
(thickness < ) {
forEachBlock(originX, originY, originZ, radiusX, radiusY, radiusZ, t, consumer);
} (radiusX <= ) {
(String.valueOf(radiusX));
} (radiusY <= ) {
(String.valueOf(radiusY));
} (radiusZ <= ) {
(String.valueOf(radiusZ));
} {
( )radiusX + ;
( )radiusY + ;
( )radiusZ + ;
radiusXAdjusted - ( )thickness;
radiusYAdjusted - ( )thickness;
radiusZAdjusted - ( )thickness;
/ (radiusXAdjusted * radiusXAdjusted);
/ (radiusYAdjusted * radiusYAdjusted);
/ (radiusZAdjusted * radiusZAdjusted);
/ (innerRadiusXAdjusted * innerRadiusXAdjusted);
/ (innerRadiusYAdjusted * innerRadiusYAdjusted);
/ (innerRadiusZAdjusted * innerRadiusZAdjusted);
;
( ; y <= radiusY; ++y1) {
( )(y * y) * invRadiusY2;
Math.sqrt(( )( - qy)) * ( )radiusXAdjusted;
( )dx;
( )(y * y) * invInnerRadiusY2;
( )(y1 * y1) * invRadiusY2;
y == && capped;
;
( ; x <= maxX; ++x1) {
( )(x * x) * invRadiusX2;
Math.sqrt(( )( - qx - qy)) * ( )radiusZAdjusted;
( )dz;
( )(x * x) * invInnerRadiusX2;
( )(x1 * x1) * invRadiusX2;
;
( ; z <= maxZ; ++z1) {
( )(z * z) * invInnerRadiusZ2;
(isAtBase) {
(!test(originX, originY, originZ, x, y, z, t, consumer)) {
;
}
} {
label60: {
(innerQx + innerQy + innerQz < ) {
( )(z1 * z1) * invRadiusZ2;
(outerQx + outerQy + outerQz < ) {
label60;
}
}
(!test(originX, originY, originZ, x, y, z, t, consumer)) {
;
}
}
}
++z;
}
++x;
}
++y;
}
;
}
}
<T> {
(!consumer.test(originX + x, originY + y, originZ + z, context)) {
;
} {
(x > ) {
(!consumer.test(originX - x, originY + y, originZ + z, context)) {
;
}
(z > && !consumer.test(originX - x, originY + y, originZ - z, context)) {
;
}
}
z > ? consumer.test(originX + x, originY + y, originZ - z, context) : ;
}
}
}
com/hypixel/hytale/math/block/BlockInvertedDomeUtil.java
package com.hypixel.hytale.math.block;
import com.hypixel.hytale.function.predicate.TriIntObjPredicate;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class BlockInvertedDomeUtil {
public BlockInvertedDomeUtil () {
}
public static <T> boolean forEachBlock (int originX, int originY, int originZ, int radiusX, int radiusY, int radiusZ, @Nullable T t, @Nonnull TriIntObjPredicate<T> consumer) {
if (radiusX <= 0 ) {
throw new IllegalArgumentException (String.valueOf(radiusX));
} else if (radiusY <= 0 ) {
throw new IllegalArgumentException (String.valueOf(radiusY));
} else if (radiusZ <= 0 ) {
throw new IllegalArgumentException (String.valueOf(radiusZ));
} else {
float radiusXAdjusted = (float )radiusX + 0.41F ;
( )radiusY + ;
( )radiusZ + ;
/ (radiusXAdjusted * radiusXAdjusted);
/ (radiusYAdjusted * radiusYAdjusted);
( ; x <= radiusX; ++x) {
- ( )(x * x) * invRadiusXSqr;
Math.sqrt(( )qx) * ( )radiusYAdjusted;
( )dy;
( ; y <= maxY; ++y) {
Math.sqrt(( )(qx - ( )(y * y) * invRadiusYSqr)) * ( )radiusZAdjusted;
( )dz;
( ; z <= maxZ; ++z) {
(!test(originX, originY, originZ, x, -y, z, t, consumer)) {
;
}
}
}
}
;
}
}
<T> {
(thickness < ) {
forEachBlock(originX, originY, originZ, radiusX, radiusY, radiusZ, t, consumer);
} (radiusX <= ) {
(String.valueOf(radiusX));
} (radiusY <= ) {
(String.valueOf(radiusY));
} (radiusZ <= ) {
(String.valueOf(radiusZ));
} {
( )radiusX + ;
( )radiusY + ;
( )radiusZ + ;
radiusXAdjusted - ( )thickness;
radiusYAdjusted - ( )thickness;
radiusZAdjusted - ( )thickness;
/ (radiusXAdjusted * radiusXAdjusted);
/ (radiusYAdjusted * radiusYAdjusted);
/ (radiusZAdjusted * radiusZAdjusted);
/ (innerRadiusXAdjusted * innerRadiusXAdjusted);
/ (innerRadiusYAdjusted * innerRadiusYAdjusted);
/ (innerRadiusZAdjusted * innerRadiusZAdjusted);
;
( ; y <= radiusY; ++y1) {
( )(y * y) * invRadiusY2;
Math.sqrt(( )( - qy)) * ( )radiusXAdjusted;
( )dx;
( )(y * y) * invInnerRadiusY2;
( )(y1 * y1) * invRadiusY2;
y == && capped;
;
( ; x <= maxX; ++x1) {
( )(x * x) * invRadiusX2;
Math.sqrt(( )( - qx - qy)) * ( )radiusZAdjusted;
( )dz;
( )(x * x) * invInnerRadiusX2;
( )(x1 * x1) * invRadiusX2;
;
( ; z <= maxZ; ++z1) {
( )(z * z) * invInnerRadiusZ2;
(isAtTop) {
(!test(originX, originY, originZ, x, -y, z, t, consumer)) {
;
}
} {
label60: {
(innerQx + innerQy + innerQz < ) {
( )(z1 * z1) * invRadiusZ2;
(outerQx + outerQy + outerQz < ) {
label60;
}
}
(!test(originX, originY, originZ, x, -y, z, t, consumer)) {
;
}
}
}
++z;
}
++x;
}
++y;
}
;
}
}
<T> {
(!consumer.test(originX + x, originY + y, originZ + z, context)) {
;
} {
(x > ) {
(!consumer.test(originX - x, originY + y, originZ + z, context)) {
;
}
(z > && !consumer.test(originX - x, originY + y, originZ - z, context)) {
;
}
}
z > ? consumer.test(originX + x, originY + y, originZ - z, context) : ;
}
}
}
com/hypixel/hytale/math/block/BlockPyramidUtil.java
package com.hypixel.hytale.math.block;
import com.hypixel.hytale.function.predicate.TriIntObjPredicate;
import javax.annotation.Nonnull;
public class BlockPyramidUtil {
public BlockPyramidUtil () {
}
public static <T> void forEachBlock (int originX, int originY, int originZ, int radiusX, int height, int radiusZ, T t, @Nonnull TriIntObjPredicate<T> consumer) {
if (radiusX <= 0 ) {
throw new IllegalArgumentException (String.valueOf(radiusX));
} else if (height <= 0 ) {
throw new IllegalArgumentException (String.valueOf(height));
} else if (radiusZ <= 0 ) {
throw new IllegalArgumentException (String.valueOf(radiusZ));
} else {
for (int y = height - 1 ; y >= 0 ; --y) {
double rf - ( )y / ( )height;
( )radiusX * rf;
maxX;
-(maxX = ( )dx);
( minX; x <= maxX; ++x) {
( )radiusZ * rf;
maxZ;
-(maxZ = ( )dz);
( minZ; z <= maxZ; ++z) {
(!consumer.test(originX + x, originY + y, originZ + z, t)) {
;
}
}
}
}
}
}
<T> {
forEachBlock(originX, originY, originZ, radiusX, height, radiusZ, thickness, , t, consumer);
}
<T> {
(thickness < ) {
forEachBlock(originX, originY, originZ, radiusX, height, radiusZ, t, consumer);
} (radiusX <= ) {
(String.valueOf(radiusX));
} (height <= ) {
(String.valueOf(height));
} (radiusZ <= ) {
(String.valueOf(radiusZ));
} {
/ ( )height;
( height - ; y >= ; --y) {
capped && y < thickness;
- ( )y * df;
rf * ( )radiusX;
rf * ( )radiusZ;
maxX;
-(maxX = ( )dx);
maxZ;
-(maxZ = ( )dz);
rf - df;
innerRf * ( )radiusX;
innerRf * ( )radiusZ;
cap ? : -(( )innerDx) + thickness;
cap ? : ( )innerDx - thickness;
cap ? : -(( )innerDz) + thickness;
cap ? : ( )innerDz - thickness;
( minX; x <= maxX; ++x) {
( minZ; z <= maxZ; ++z) {
((x < innerMinX || x > innerMaxX || z < innerMinZ || z > innerMaxZ) && !consumer.test(originX + x, originY + y, originZ + z, t)) {
;
}
}
}
}
}
}
<T> {
(radiusX <= ) {
(String.valueOf(radiusX));
} (height <= ) {
(String.valueOf(height));
} (radiusZ <= ) {
(String.valueOf(radiusZ));
} {
( height - ; y >= ; --y) {
- ( )y / ( )height;
( )radiusX * rf;
maxX;
-(maxX = ( )dx);
( minX; x <= maxX; ++x) {
( )radiusZ * rf;
maxZ;
-(maxZ = ( )dz);
( minZ; z <= maxZ; ++z) {
(!consumer.test(originX + x, originY + height - - y, originZ + z, t)) {
;
}
}
}
}
}
}
<T> {
forEachBlockInverted(originX, originY, originZ, radiusX, height, radiusZ, thickness, , t, consumer);
}
<T> {
(thickness < ) {
forEachBlockInverted(originX, originY, originZ, radiusX, height, radiusZ, t, consumer);
} (radiusX <= ) {
(String.valueOf(radiusX));
} (height <= ) {
(String.valueOf(height));
} (radiusZ <= ) {
(String.valueOf(radiusZ));
} {
/ ( )height;
( height - ; y >= ; --y) {
capped && y < thickness;
- ( )y * df;
rf * ( )radiusX;
rf * ( )radiusZ;
maxX;
-(maxX = ( )dx);
maxZ;
-(maxZ = ( )dz);
rf - df;
innerRf * ( )radiusX;
innerRf * ( )radiusZ;
cap ? : -(( )innerDx) + thickness;
cap ? : ( )innerDx - thickness;
cap ? : -(( )innerDz) + thickness;
cap ? : ( )innerDz - thickness;
( minX; x <= maxX; ++x) {
( minZ; z <= maxZ; ++z) {
((x < innerMinX || x > innerMaxX || z < innerMinZ || z > innerMaxZ) && !consumer.test(originX + x, originY + height - - y, originZ + z, t)) {
;
}
}
}
}
}
}
}
com/hypixel/hytale/math/block/BlockSphereUtil.java
package com.hypixel.hytale.math.block;
import com.hypixel.hytale.function.predicate.TriIntObjPredicate;
import com.hypixel.hytale.math.util.MathUtil;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class BlockSphereUtil {
public BlockSphereUtil () {
}
public static <T> void forEachBlockExact (int originX, int originY, int originZ, double radius, @Nullable T t, @Nonnull TriIntObjPredicate<T> consumer) {
if (radius <= 0.0 ) {
throw new IllegalArgumentException (String.valueOf(radius));
} else {
int ceiledRadius = MathUtil.ceil(radius);
double invRadiusXSqr = 1.0 / (double )(ceiledRadius * ceiledRadius);
double invRadiusYSqr = 1.0 / (double )(ceiledRadius * ceiledRadius);
for (int x = -ceiledRadius; x <= ceiledRadius; ++x) {
double - ( )(x * x) * invRadiusXSqr;
Math.sqrt(qx) * ( )ceiledRadius;
maxY;
-(maxY = ( )dy);
( maxY; y >= minY; --y) {
Math.sqrt(qx - ( )(y * y) * invRadiusYSqr) * ( )ceiledRadius;
maxZ;
-(maxZ = ( )dz);
( minZ; z <= maxZ; ++z) {
(!consumer.test(originX + x, originY + y, originZ + z, t)) {
;
}
}
}
}
}
}
<T> {
forEachBlock(originX, originY, originZ, radius, radius, radius, t, consumer);
}
<T> {
(radiusX <= ) {
(String.valueOf(radiusX));
} (radiusY <= ) {
(String.valueOf(radiusY));
} (radiusZ <= ) {
(String.valueOf(radiusZ));
} {
( )radiusX + ;
( )radiusY + ;
( )radiusZ + ;
/ (radiusXAdjusted * radiusXAdjusted);
/ (radiusYAdjusted * radiusYAdjusted);
( ; x <= radiusX; ++x) {
- ( )(x * x) * invRadiusXSqr;
Math.sqrt(( )qx) * ( )radiusYAdjusted;
( )dy;
( ; y <= maxY; ++y) {
Math.sqrt(( )(qx - ( )(y * y) * invRadiusYSqr)) * ( )radiusZAdjusted;
( )dz;
( ; z <= maxZ; ++z) {
(!test(originX, originY, originZ, x, y, z, t, consumer)) {
;
}
}
}
}
;
}
}
<T> {
forEachBlock(originX, originY, originZ, radius, radius, radius, thickness, t, consumer);
}
<T> {
(thickness < ) {
forEachBlock(originX, originY, originZ, radiusX, radiusY, radiusZ, t, consumer);
} (radiusX <= ) {
(String.valueOf(radiusX));
} (radiusY <= ) {
(String.valueOf(radiusY));
} (radiusZ <= ) {
(String.valueOf(radiusZ));
} {
( )radiusX + ;
( )radiusY + ;
( )radiusZ + ;
radiusXAdjusted - ( )thickness;
radiusYAdjusted - ( )thickness;
radiusZAdjusted - ( )thickness;
/ (radiusXAdjusted * radiusXAdjusted);
/ (radiusYAdjusted * radiusYAdjusted);
/ (radiusZAdjusted * radiusZAdjusted);
/ (innerRadiusXAdjusted * innerRadiusXAdjusted);
/ (innerRadiusYAdjusted * innerRadiusYAdjusted);
/ (innerRadiusZAdjusted * innerRadiusZAdjusted);
;
( ; y <= radiusY; ++y1) {
( )(y * y) * invRadiusY2;
Math.sqrt(( )( - qy)) * ( )radiusXAdjusted;
( )dx;
( )(y * y) * invInnerRadiusY2;
( )(y1 * y1) * invRadiusY2;
;
( ; x <= maxX; ++x1) {
( )(x * x) * invRadiusX2;
Math.sqrt(( )( - qx - qy)) * ( )radiusZAdjusted;
( )dz;
( )(x * x) * invInnerRadiusX2;
( )(x1 * x1) * invRadiusX2;
;
( ; z <= maxZ; ++z1) {
label47: {
( )(z * z) * invInnerRadiusZ2;
(innerQx + innerQy + innerQz < ) {
( )(z1 * z1) * invRadiusZ2;
(outerQx + outerQy + outerQz < ) {
label47;
}
}
(!test(originX, originY, originZ, x, y, z, t, consumer)) {
;
}
}
++z;
}
++x;
}
++y;
}
;
}
}
<T> {
(!consumer.test(originX + x, originY + y, originZ + z, context)) {
;
} {
(x > ) {
(!consumer.test(originX - x, originY + y, originZ + z, context)) {
;
}
(y > && !consumer.test(originX - x, originY - y, originZ + z, context)) {
;
}
(z > && !consumer.test(originX - x, originY + y, originZ - z, context)) {
;
}
(y > && z > && !consumer.test(originX - x, originY - y, originZ - z, context)) {
;
}
}
(y > ) {
(!consumer.test(originX + x, originY - y, originZ + z, context)) {
;
}
(z > && !consumer.test(originX + x, originY - y, originZ - z, context)) {
;
}
}
z > ? consumer.test(originX + x, originY + y, originZ - z, context) : ;
}
}
}
com/hypixel/hytale/math/block/BlockTorusUtil.java
package com.hypixel.hytale.math.block;
import com.hypixel.hytale.function.predicate.TriIntObjPredicate;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class BlockTorusUtil {
public BlockTorusUtil () {
}
public static <T> boolean forEachBlock (int originX, int originY, int originZ, int outerRadius, int minorRadius, @Nullable T t, @Nonnull TriIntObjPredicate<T> consumer) {
if (outerRadius <= 0 ) {
throw new IllegalArgumentException (String.valueOf(outerRadius));
} else if (minorRadius <= 0 ) {
throw new IllegalArgumentException (String.valueOf(minorRadius));
} else {
int majorRadius = Math.max(1 , outerRadius - minorRadius);
int sizeXZ = majorRadius + minorRadius;
float minorRadiusAdjusted = (float )minorRadius + 0.41F ;
( -sizeXZ; x <= sizeXZ; ++x) {
( -sizeXZ; z <= sizeXZ; ++z) {
Math.sqrt(( )(x * x + z * z));
distFromCenter - ( )majorRadius;
( -minorRadius; y <= minorRadius; ++y) {
Math.sqrt(distFromRing * distFromRing + ( )(y * y));
(distFromTube <= ( )minorRadiusAdjusted && !consumer.test(originX + x, originY + y, originZ + z, t)) {
;
}
}
}
}
;
}
}
<T> {
(thickness < ) {
forEachBlock(originX, originY, originZ, outerRadius, minorRadius, t, consumer);
} (outerRadius <= ) {
(String.valueOf(outerRadius));
} (minorRadius <= ) {
(String.valueOf(minorRadius));
} {
Math.max( , outerRadius - minorRadius);
majorRadius + minorRadius;
( )minorRadius + ;
Math.max( , minorRadiusAdjusted - ( )thickness);
( -sizeXZ; x <= sizeXZ; ++x) {
( -sizeXZ; z <= sizeXZ; ++z) {
Math.sqrt(( )(x * x + z * z));
distFromCenter - ( )majorRadius;
( -minorRadius; y <= minorRadius; ++y) {
Math.sqrt(distFromRing * distFromRing + ( )(y * y));
distFromTube <= ( )minorRadiusAdjusted;
(inOuter) {
distFromTube < ( )innerMinorRadius;
(!inInner && !consumer.test(originX + x, originY + y, originZ + z, t)) {
;
}
}
}
}
}
;
}
}
}
com/hypixel/hytale/math/block/BlockUtil.java
package com.hypixel.hytale.math.block;
import com.hypixel.hytale.math.vector.Vector3i;
import javax.annotation.Nonnull;
public class BlockUtil {
public static final float RADIUS_ADJUST = 0.41F ;
public static final long BITS_Y = 9L ;
public static final long MAX_Y = 512L ;
public static final long MIN_Y = -513L ;
public static final long Y_INVERT = -512L ;
public static final long Y_MASK = 511L ;
public static final long BITS_PER_DIRECTION ;
;
- ;
- ;
;
{
}
{
pack(val.x, val.y, val.z);
}
{
(( )y > - && ( )y < ) {
(( )x > - && ( )x < ) {
(( )z > - && ( )z < ) {
(( )y & ) << | (( )z & ) << | ( )x & ;
(y < ) {
l |= - ;
}
(z < ) {
l |= ;
}
(x < ) {
l |= ;
}
l;
} {
(String.valueOf(z));
}
} {
(String.valueOf(x));
}
} {
(String.valueOf(y));
}
}
{
( )(packed & );
((packed & ) != ) {
i = ( )(( )i | - );
}
i;
}
{
( )(packed >> & );
((packed & - ) != ) {
i = ( )(( )i | - );
}
i;
}
{
( )(packed >> & );
((packed & ) != ) {
i = ( )(( )i | - );
}
i;
}
Vector3i {
(unpackX(packed), unpackY(packed), unpackZ(packed));
}
}
com/hypixel/hytale/math/codec/FloatRangeArrayCodec.java
package com.hypixel.hytale.math.codec;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.ExtraInfo;
import com.hypixel.hytale.codec.codecs.simple.FloatCodec;
import com.hypixel.hytale.codec.schema.SchemaContext;
import com.hypixel.hytale.codec.schema.config.ArraySchema;
import com.hypixel.hytale.codec.schema.config.NumberSchema;
import com.hypixel.hytale.codec.schema.config.Schema;
import com.hypixel.hytale.codec.schema.config.StringSchema;
import com.hypixel.hytale.codec.util.RawJsonReader;
import com.hypixel.hytale.codec.validation.ValidatableCodec;
import com.hypixel.hytale.codec.validation.ValidationResults;
import com.hypixel.hytale.math.range.FloatRange;
import java.io.IOException;
import java.util.Set;
import javax.annotation.Nonnull;
import org.bson.BsonArray;
import org.bson.BsonDouble;
import org.bson.BsonValue;
public class FloatRangeArrayCodec implements Codec <FloatRange>, ValidatableCodec<FloatRange> {
public FloatRangeArrayCodec () {
}
@Nonnull
public FloatRange decode (@Nonnull BsonValue bsonValue, ExtraInfo extraInfo) {
BsonArray document = bsonValue.asArray();
return new FloatRange (FloatCodec.decodeFloat(document.get( )), FloatCodec.decodeFloat(document.get( )));
}
BsonValue {
();
array.add((BsonValue)( (( )floatRange.getInclusiveMin())));
array.add((BsonValue)( (( )floatRange.getInclusiveMax())));
array;
}
FloatRange IOException {
reader.expect( );
reader.consumeWhiteSpace();
FloatCodec.readFloat(reader);
reader.consumeWhiteSpace();
reader.expect( );
reader.consumeWhiteSpace();
FloatCodec.readFloat(reader);
reader.consumeWhiteSpace();
reader.expect( );
reader.consumeWhiteSpace();
(inclusiveMin, inclusiveMax);
}
Schema {
();
stringSchema.setPattern( );
Schema.anyOf( (), stringSchema);
choiceSchema.getHytale().setType( );
();
s.setTitle( );
s.setItems(choiceSchema, choiceSchema);
s.setMinItems( );
s.setMaxItems( );
s;
}
{
(floatRange.getInclusiveMin() > floatRange.getInclusiveMax()) {
extraInfo.getValidationResults();
results.fail(String.format( , floatRange.getInclusiveMin(), floatRange.getInclusiveMax()));
results._processValidationResults();
}
}
{
}
}
com/hypixel/hytale/math/codec/IntRangeArrayCodec.java
package com.hypixel.hytale.math.codec;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.ExtraInfo;
import com.hypixel.hytale.codec.schema.SchemaContext;
import com.hypixel.hytale.codec.schema.config.ArraySchema;
import com.hypixel.hytale.codec.schema.config.IntegerSchema;
import com.hypixel.hytale.codec.schema.config.Schema;
import com.hypixel.hytale.codec.util.RawJsonReader;
import com.hypixel.hytale.codec.validation.ValidatableCodec;
import com.hypixel.hytale.codec.validation.ValidationResults;
import com.hypixel.hytale.math.range.IntRange;
import java.io.IOException;
import java.util.Set;
import javax.annotation.Nonnull;
import org.bson.BsonArray;
import org.bson.BsonDouble;
import org.bson.BsonValue;
public class IntRangeArrayCodec implements Codec <IntRange>, ValidatableCodec<IntRange> {
public IntRangeArrayCodec () {
}
@Nonnull
public IntRange decode (@Nonnull BsonValue bsonValue, ExtraInfo extraInfo) {
BsonArray document = bsonValue.asArray();
return new IntRange (document.get(0 ).asNumber().intValue(), document.get(1 ).asNumber().intValue());
}
@Nonnull
BsonValue {
();
array.add((BsonValue)( (( )t.getInclusiveMin())));
array.add((BsonValue)( (( )t.getInclusiveMax())));
array;
}
IntRange IOException {
reader.expect( );
reader.consumeWhiteSpace();
reader.readIntValue();
reader.consumeWhiteSpace();
reader.expect( );
reader.consumeWhiteSpace();
reader.readIntValue();
reader.consumeWhiteSpace();
reader.expect( );
reader.consumeWhiteSpace();
(inclusiveMin, inclusiveMax);
}
Schema {
();
s.setTitle( );
s.setItems( (), ());
s.setMinItems( );
s.setMaxItems( );
s;
}
{
(range.getInclusiveMin() > range.getInclusiveMax()) {
extraInfo.getValidationResults();
results.fail(String.format( , range.getInclusiveMin(), range.getInclusiveMax()));
results._processValidationResults();
}
}
{
}
}
com/hypixel/hytale/math/codec/Vector2dArrayCodec.java
package com.hypixel.hytale.math.codec;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.ExtraInfo;
import com.hypixel.hytale.codec.schema.SchemaContext;
import com.hypixel.hytale.codec.schema.config.ArraySchema;
import com.hypixel.hytale.codec.schema.config.NumberSchema;
import com.hypixel.hytale.codec.schema.config.Schema;
import com.hypixel.hytale.codec.util.RawJsonReader;
import com.hypixel.hytale.math.vector.Vector2d;
import java.io.IOException;
import javax.annotation.Nonnull;
import org.bson.BsonArray;
import org.bson.BsonDouble;
import org.bson.BsonValue;
@Deprecated
public class Vector2dArrayCodec implements Codec <Vector2d> {
public Vector2dArrayCodec () {
}
@Nonnull
public Vector2d decode (@Nonnull BsonValue bsonValue, ExtraInfo extraInfo) {
BsonArray document = bsonValue.asArray();
return new Vector2d (document.get(0 ).asNumber().doubleValue(), document.get(1 ).asNumber().doubleValue());
}
@Nonnull
public BsonValue encode {
();
array.add((BsonValue)( (t.getX())));
array.add((BsonValue)( (t.getY())));
array;
}
Vector2d IOException {
reader.expect( );
reader.consumeWhiteSpace();
reader.readDoubleValue();
reader.consumeWhiteSpace();
reader.expect( );
reader.consumeWhiteSpace();
reader.readDoubleValue();
reader.consumeWhiteSpace();
reader.expect( );
reader.consumeWhiteSpace();
(x, y);
}
Schema {
();
s.setTitle( );
s.setItems( (), ());
s.setMinItems( );
s.setMaxItems( );
s;
}
}
com/hypixel/hytale/math/codec/Vector3dArrayCodec.java
package com.hypixel.hytale.math.codec;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.ExtraInfo;
import com.hypixel.hytale.codec.schema.SchemaContext;
import com.hypixel.hytale.codec.schema.config.ArraySchema;
import com.hypixel.hytale.codec.schema.config.NumberSchema;
import com.hypixel.hytale.codec.schema.config.Schema;
import com.hypixel.hytale.codec.util.RawJsonReader;
import com.hypixel.hytale.math.vector.Vector3d;
import java.io.IOException;
import javax.annotation.Nonnull;
import org.bson.BsonArray;
import org.bson.BsonDouble;
import org.bson.BsonValue;
@Deprecated
public class Vector3dArrayCodec implements Codec <Vector3d> {
public Vector3dArrayCodec () {
}
@Nonnull
public Vector3d decode (@Nonnull BsonValue bsonValue, ExtraInfo extraInfo) {
BsonArray document = bsonValue.asArray();
return new Vector3d (document.get(0 ).asNumber().doubleValue(), document.get(1 ).asNumber().doubleValue(), document.get(2 ).asNumber().doubleValue());
}
@Nonnull
public BsonValue {
();
array.add((BsonValue)( (t.getX())));
array.add((BsonValue)( (t.getY())));
array.add((BsonValue)( (t.getZ())));
array;
}
Vector3d IOException {
reader.expect( );
reader.consumeWhiteSpace();
reader.readDoubleValue();
reader.consumeWhiteSpace();
reader.expect( );
reader.consumeWhiteSpace();
reader.readDoubleValue();
reader.consumeWhiteSpace();
reader.expect( );
reader.consumeWhiteSpace();
reader.readDoubleValue();
reader.consumeWhiteSpace();
reader.expect( );
reader.consumeWhiteSpace();
(x, y, z);
}
Schema {
();
s.setTitle( );
s.setItems( (), (), ());
s.setMinItems( );
s.setMaxItems( );
s;
}
}
com/hypixel/hytale/math/codec/Vector3iArrayCodec.java
package com.hypixel.hytale.math.codec;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.ExtraInfo;
import com.hypixel.hytale.codec.schema.SchemaContext;
import com.hypixel.hytale.codec.schema.config.ArraySchema;
import com.hypixel.hytale.codec.schema.config.NumberSchema;
import com.hypixel.hytale.codec.schema.config.Schema;
import com.hypixel.hytale.codec.util.RawJsonReader;
import com.hypixel.hytale.math.vector.Vector3i;
import java.io.IOException;
import javax.annotation.Nonnull;
import org.bson.BsonArray;
import org.bson.BsonInt32;
import org.bson.BsonValue;
@Deprecated
public class Vector3iArrayCodec implements Codec <Vector3i> {
public Vector3iArrayCodec () {
}
@Nonnull
public Vector3i decode (@Nonnull BsonValue bsonValue, ExtraInfo extraInfo) {
BsonArray document = bsonValue.asArray();
return new Vector3i (document.get(0 ).asNumber().intValue(), document.get(1 ).asNumber().intValue(), document.get(2 ).asNumber().intValue());
}
@Nonnull
public BsonValue {
();
array.add((BsonValue)( (t.getX())));
array.add((BsonValue)( (t.getY())));
array.add((BsonValue)( (t.getZ())));
array;
}
Vector3i IOException {
reader.expect( );
reader.consumeWhiteSpace();
reader.readIntValue();
reader.consumeWhiteSpace();
reader.expect( );
reader.consumeWhiteSpace();
reader.readIntValue();
reader.consumeWhiteSpace();
reader.expect( );
reader.consumeWhiteSpace();
reader.readIntValue();
reader.consumeWhiteSpace();
reader.expect( );
reader.consumeWhiteSpace();
(x, y, z);
}
Schema {
();
s.setTitle( );
s.setItems( (), (), ());
s.setMinItems( );
s.setMaxItems( );
s;
}
}
com/hypixel/hytale/math/data/VarInt.java
package com.hypixel.hytale.math.data;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import javax.annotation.Nonnull;
public final class VarInt {
private VarInt () {
throw new UnsupportedOperationException ("Do not instantiate." );
}
public static void writeSignedVarLong (long value, @Nonnull DataOutput out) throws IOException {
writeUnsignedVarLong(value << 1 ^ value >> 63 , out);
}
public static void writeUnsignedVarLong (long value, @Nonnull DataOutput out) throws IOException {
while ((value & -128L ) != 0L ) {
out.writeByte((int )value & 127 | 128 );
value >>>= 7 ;
}
out.writeByte((int )value & 127 );
}
public static void writeSignedVarInt IOException {
writeUnsignedVarInt(value << ^ value >> , out);
}
IOException {
(( )(value & - ) != ) {
out.writeByte(value & | );
value >>>= ;
}
out.writeByte(value & );
}
[] writeSignedVarInt( value) {
writeUnsignedVarInt(value << ^ value >> );
}
[] writeUnsignedVarInt( value) {
[] byteArrayList = [ ];
i;
(i = ; ( )(value & - ) != ; value >>>= ) {
byteArrayList[i++] = ( )(value & | );
}
byteArrayList[i] = ( )(value & );
[] out;
(out = [i + ]; i >= ; --i) {
out[i] = byteArrayList[i];
}
out;
}
IOException {
readUnsignedVarLong(in);
(raw << >> ^ raw) >> ;
temp ^ raw & - ;
}
IOException {
;
;
b;
(((b = ( )in.readByte()) & ) != ) {
value |= (b & ) << i;
i += ;
(i > ) {
( );
}
}
value | b << i;
}
IOException {
readUnsignedVarInt(in);
(raw << >> ^ raw) >> ;
temp ^ raw & - ;
}
IOException {
;
;
b;
(((b = in.readByte()) & ) != ) {
value |= (b & ) << i;
i += ;
(i > ) {
( );
}
}
value | b << i;
}
{
readUnsignedVarInt(bytes);
(raw << >> ^ raw) >> ;
temp ^ raw & - ;
}
{
;
;
- ;
( b : bytes) {
rb = b;
((b & ) == ) {
;
}
value |= (b & ) << i;
i += ;
(i > ) {
( );
}
}
value | rb << i;
}
}
com/hypixel/hytale/math/hitdetection/HitDetectionBuffer.java
package com.hypixel.hytale.math.hitdetection;
import com.hypixel.hytale.math.shape.Quad4d;
import com.hypixel.hytale.math.shape.Triangle4d;
import com.hypixel.hytale.math.util.FastRandom;
import com.hypixel.hytale.math.vector.Vector4d;
import java.util.Random;
public class HitDetectionBuffer {
private static final int VECTOR_BUFFER_SIZE = 16 ;
public Random random = new FastRandom ();
public Vector4d hitPosition = new Vector4d ();
public Vector4d tempHitPosition = new Vector4d ();
public Quad4d transformedQuad = new Quad4d ();
public Vector4d transformedPoint = new Vector4d ();
public Triangle4d visibleTriangle ();
( );
( );
;
{
}
}
com/hypixel/hytale/math/hitdetection/HitDetectionExecutor.java
package com.hypixel.hytale.math.hitdetection;
import com.hypixel.hytale.logger.HytaleLogger;
import com.hypixel.hytale.math.matrix.Matrix4d;
import com.hypixel.hytale.math.shape.Quad4d;
import com.hypixel.hytale.math.shape.Triangle4d;
import com.hypixel.hytale.math.vector.Vector4d;
import java.util.Arrays;
import java.util.logging.Level;
import javax.annotation.Nonnull;
public class HitDetectionExecutor {
public static final HytaleLogger log = HytaleLogger.forEnclosingClass();
private static final Vector4d[] VERTEX_POINTS = new Vector4d []{Vector4d.newPosition(0.0 , 1.0 , 1.0 ), Vector4d.newPosition(0.0 , 1.0 , 0.0 ), Vector4d.newPosition(1.0 , 1.0 , 1.0 ), Vector4d.newPosition(1.0 , 1.0 , 0.0 ), Vector4d.newPosition(0.0 , 0.0 , 1.0 ), Vector4d.newPosition(0.0 , 0.0 , 0.0 ), Vector4d.newPosition(1.0 , 0.0 , 1.0 ), Vector4d.newPosition(1.0 , 0.0 , )};
Quad4d[] CUBE_QUADS;
();
();
();
();
MatrixProvider projectionProvider;
MatrixProvider viewProvider;
LineOfSightProvider losProvider;
maxRayTests;
{
.losProvider = LineOfSightProvider.DEFAULT_TRUE;
.maxRayTests = ;
}
Vector4d {
.buffer.hitPosition;
}
HitDetectionExecutor {
.projectionProvider = provider;
;
}
HitDetectionExecutor {
.viewProvider = provider;
;
}
HitDetectionExecutor {
.losProvider = losProvider;
;
}
HitDetectionExecutor {
.maxRayTests = maxRayTests;
;
}
HitDetectionExecutor {
.origin.assign(x, y, z, );
;
}
{
.projectionProvider.getMatrix();
.viewProvider.getMatrix();
.pvmMatrix.assign(projectionMatrix).multiply(viewMatrix);
.invPvMatrix.assign( .pvmMatrix).invert();
.pvmMatrix.multiply(modelMatrix);
}
{
.setupMatrices(modelMatrix);
.testPoint(point);
}
{
{
.setupMatrices(modelMatrix);
.testModel(model);
} (Throwable t) {
((HytaleLogger.Api)log.at(Level.SEVERE).withCause(t)).log( );
log.at(Level.SEVERE).log( , );
log.at(Level.SEVERE).log( , Arrays.toString(model));
log.at(Level.SEVERE).log( , modelMatrix);
log.at(Level.SEVERE).log( , Thread.currentThread().getName());
t;
}
}
{
.pvmMatrix.multiply(point, .buffer.transformedPoint);
(! .buffer.transformedPoint.isInsideFrustum()) {
;
} {
.buffer.transformedPoint;
.invPvMatrix.multiply(hit);
hit.perspectiveTransform();
.losProvider.test( .origin.x, .origin.y, .origin.z, hit.x, hit.y, hit.z);
}
}
{
;
/ ;
(Quad4d quad : model) {
(testsDone++ == .maxRayTests) {
;
}
quad.multiply( .pvmMatrix, .buffer.transformedQuad);
( .insideFrustum()) {
.buffer.tempHitPosition;
( .buffer.containsFully) {
.buffer.transformedQuad.getRandom( .buffer.random, hit);
} {
.buffer.visibleTriangle.getRandom( .buffer.random, hit);
}
.invPvMatrix.multiply(hit);
hit.perspectiveTransform();
.origin.x - hit.x;
.origin.y - hit.y;
.origin.z - hit.z;
dx * dx + dy * dy + dz * dz;
(!(distanceSquared >= minDistanceSquared) && .losProvider.test( .origin.x, .origin.y, .origin.z, hit.x, hit.y, hit.z)) {
minDistanceSquared = distanceSquared;
.buffer.hitPosition.assign(hit);
}
}
}
minDistanceSquared != / ;
}
{
.buffer.transformedQuad;
(quad.isFullyInsideFrustum()) {
.buffer.containsFully = ;
;
} {
.buffer.containsFully = ;
.buffer.vertexList1;
.buffer.vertexList2;
vertices.clear();
auxillaryList.clear();
vertices.next().assign(quad.getA());
vertices.next().assign(quad.getB());
vertices.next().assign(quad.getC());
vertices.next().assign(quad.getD());
( .clipPolygonAxis( ) && .clipPolygonAxis( ) && .clipPolygonAxis( )) {
vertices.get( );
;
(i < vertices.size() - ) {
.buffer.visibleTriangle;
triangle.assign(initialVertex, vertices.get(i), vertices.get(i + ));
;
}
}
;
}
}
{
clipPolygonComponent( .buffer.vertexList1, componentIndex, , .buffer.vertexList2);
.buffer.vertexList1.clear();
( .buffer.vertexList2.isEmpty()) {
;
} {
clipPolygonComponent( .buffer.vertexList2, componentIndex, - , .buffer.vertexList1);
.buffer.vertexList2.clear();
! .buffer.vertexList1.isEmpty();
}
}
{
vertices.get(vertices.size() - );
previousVertex.get(componentIndex) * componentFactor;
previousComponent <= previousVertex.w;
( ; i < vertices.size(); ++i) {
vertices.get(i);
vertex.get(componentIndex) * componentFactor;
component <= vertex.w;
(inside ^ previousInside) {
(previousVertex.w - previousComponent) / (previousVertex.w - previousComponent - (vertex.w - component));
previousVertex.lerp(vertex, lerp, result.next());
}
(inside) {
result.next().assign(vertex);
}
previousVertex = vertex;
previousComponent = component;
previousInside = inside;
}
}
String {
String.valueOf( .pvmMatrix);
+ var10000 + + String.valueOf( .invPvMatrix) + + String.valueOf( .origin) + + String.valueOf( .buffer) + + String.valueOf( .projectionProvider) + + String.valueOf( .viewProvider) + + String.valueOf( .losProvider) + + .maxRayTests + ;
}
{
CUBE_QUADS = []{ (VERTEX_POINTS, , , , ), (VERTEX_POINTS, , , , ), (VERTEX_POINTS, , , , ), (VERTEX_POINTS, , , , ), (VERTEX_POINTS, , , , ), (VERTEX_POINTS, , , , )};
}
}
com/hypixel/hytale/math/hitdetection/LineOfSightProvider.java
package com.hypixel.hytale.math.hitdetection;
public interface LineOfSightProvider {
LineOfSightProvider DEFAULT_TRUE = (fromX, fromY, fromZ, toX, toY, toZ) -> true ;
boolean test (double var1, double var3, double var5, double var7, double var9, double var11) ;
}
com/hypixel/hytale/math/hitdetection/MatrixProvider.java
package com.hypixel.hytale.math.hitdetection;
import com.hypixel.hytale.math.matrix.Matrix4d;
public interface MatrixProvider {
Matrix4d getMatrix () ;
}
com/hypixel/hytale/math/hitdetection/Vector4dBufferList.java
package com.hypixel.hytale.math.hitdetection;
import com.hypixel.hytale.math.vector.Vector4d;
import javax.annotation.Nonnull;
public class Vector4dBufferList {
private Vector4d[] vectors;
private int size;
public Vector4dBufferList (int size) {
this .vectors = new Vector4d [size];
for (int i = 0 ; i < size; ++i) {
this .vectors[i] = new Vector4d ();
}
this .size = 0 ;
}
public Vector4d next () {
return this .vectors[this .size++];
}
public void clear () {
this .size = 0 ;
}
public int size () {
return this .size;
}
public Vector4d get (int i) {
return .vectors[i];
}
{
.size == ;
}
String {
();
sb.append( );
( ; i < .size; ++i) {
sb.append( .vectors[i]).append( );
}
sb.append( ).append( .size).append( );
sb.toString();
}
}
com/hypixel/hytale/math/hitdetection/projection/FrustumProjectionProvider.java
package com.hypixel.hytale.math.hitdetection.projection;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.math.hitdetection.MatrixProvider;
import com.hypixel.hytale.math.matrix.Matrix4d;
import javax.annotation.Nonnull;
public class FrustumProjectionProvider implements MatrixProvider {
public static final BuilderCodec<FrustumProjectionProvider> CODEC;
protected final Matrix4d matrix;
protected final Matrix4d rotMatrix;
protected boolean invalid;
protected double left;
protected double right;
protected double bottom;
protected double top;
protected double near;
protected double far;
protected double yaw;
protected double pitch;
protected double roll;
public FrustumProjectionProvider () {
this (new Matrix4d (), , , , , , );
}
{
.rotMatrix = ();
.matrix = matrix;
.left = left;
.right = right;
.bottom = bottom;
.top = top;
.near = near;
.far = far;
.invalid = ;
}
FrustumProjectionProvider {
.left = left;
.invalid = ;
;
}
FrustumProjectionProvider {
.right = right;
.invalid = ;
;
}
FrustumProjectionProvider {
.bottom = bottom;
.invalid = ;
;
}
FrustumProjectionProvider {
.top = top;
.invalid = ;
;
}
FrustumProjectionProvider {
.near = near;
.invalid = ;
;
}
FrustumProjectionProvider {
.far = far;
.invalid = ;
;
}
FrustumProjectionProvider {
.yaw = yaw;
.pitch = pitch;
.roll = roll;
;
}
Matrix4d {
( .invalid) {
.matrix.projectionFrustum( .left, .right, .bottom, .top, .near, .far);
.matrix.rotateAxis( .pitch, , , , .rotMatrix);
.matrix.rotateAxis( .yaw, , , , .rotMatrix);
.matrix.rotateAxis( .roll, , , , .rotMatrix);
.invalid = ;
}
.matrix;
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(FrustumProjectionProvider.class, FrustumProjectionProvider:: ).addField( ( , Codec.DOUBLE), (projectionProvider, d) -> projectionProvider.left = d, (projectionProvider) -> projectionProvider.left)).addField( ( , Codec.DOUBLE), (projectionProvider, d) -> projectionProvider.right = d, (projectionProvider) -> projectionProvider.right)).addField( ( , Codec.DOUBLE), (projectionProvider, d) -> projectionProvider.top = d, (projectionProvider) -> projectionProvider.top)).addField( ( , Codec.DOUBLE), (projectionProvider, d) -> projectionProvider.bottom = d, (projectionProvider) -> projectionProvider.bottom)).addField( ( , Codec.DOUBLE), (projectionProvider, d) -> projectionProvider.near = d, (projectionProvider) -> projectionProvider.near)).addField( ( , Codec.DOUBLE), (projectionProvider, d) -> projectionProvider.far = d, (projectionProvider) -> projectionProvider.far)).build();
}
}
com/hypixel/hytale/math/hitdetection/projection/OrthogonalProjectionProvider.java
package com.hypixel.hytale.math.hitdetection.projection;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.math.hitdetection.MatrixProvider;
import com.hypixel.hytale.math.matrix.Matrix4d;
import javax.annotation.Nonnull;
public class OrthogonalProjectionProvider implements MatrixProvider {
public static final BuilderCodec<OrthogonalProjectionProvider> CODEC;
protected final Matrix4d matrix;
protected final Matrix4d rotMatrix;
protected boolean invalid;
protected double left;
protected double right;
protected double bottom;
protected double top;
protected double near;
protected double far;
protected double yaw;
protected double pitch;
protected double roll;
public OrthogonalProjectionProvider () {
this (new Matrix4d (), , , , , , , , , );
}
{
.rotMatrix = ();
.matrix = matrix;
.left = left;
.right = right;
.bottom = bottom;
.top = top;
.near = near;
.far = far;
.yaw = yaw;
.pitch = pitch;
.roll = roll;
.invalid = ;
}
OrthogonalProjectionProvider {
.left = left;
.invalid = ;
;
}
OrthogonalProjectionProvider {
.right = right;
.invalid = ;
;
}
OrthogonalProjectionProvider {
.bottom = bottom;
.invalid = ;
;
}
OrthogonalProjectionProvider {
.top = top;
.invalid = ;
;
}
OrthogonalProjectionProvider {
.near = near;
.invalid = ;
;
}
OrthogonalProjectionProvider {
.far = far;
.invalid = ;
;
}
{
.far;
}
OrthogonalProjectionProvider {
.yaw = yaw;
.pitch = pitch;
.roll = roll;
;
}
Matrix4d {
( .invalid) {
.matrix.projectionOrtho( .left, .right, .bottom, .top, .near, .far);
.matrix.rotateAxis( .roll, , , , .rotMatrix);
.matrix.rotateAxis( .pitch, , , , .rotMatrix);
.matrix.rotateAxis( .yaw, , , , .rotMatrix);
.invalid = ;
}
.matrix;
}
String {
+ .left + + .right + + .bottom + + .top + + .near + + .far + ;
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(OrthogonalProjectionProvider.class, OrthogonalProjectionProvider:: ).addField( ( , Codec.DOUBLE), (projectionProvider, d) -> projectionProvider.left = d, (projectionProvider) -> projectionProvider.left)).addField( ( , Codec.DOUBLE), (projectionProvider, d) -> projectionProvider.right = d, (projectionProvider) -> projectionProvider.right)).addField( ( , Codec.DOUBLE), (projectionProvider, d) -> projectionProvider.top = d, (projectionProvider) -> projectionProvider.top)).addField( ( , Codec.DOUBLE), (projectionProvider, d) -> projectionProvider.bottom = d, (projectionProvider) -> projectionProvider.bottom)).addField( ( , Codec.DOUBLE), (projectionProvider, d) -> projectionProvider.near = d, (projectionProvider) -> projectionProvider.near)).addField( ( , Codec.DOUBLE), (projectionProvider, d) -> projectionProvider.far = d, (projectionProvider) -> projectionProvider.far)).build();
}
}
com/hypixel/hytale/math/hitdetection/view/DirectionViewProvider.java
package com.hypixel.hytale.math.hitdetection.view;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.math.hitdetection.MatrixProvider;
import com.hypixel.hytale.math.matrix.Matrix4d;
import com.hypixel.hytale.math.vector.Vector3d;
import javax.annotation.Nonnull;
public class DirectionViewProvider implements MatrixProvider {
public static final BuilderCodec<DirectionViewProvider> CODEC;
public static final Vector3d DEFAULT_UP;
protected final Matrix4d matrix;
protected final Vector3d position;
protected final Vector3d direction;
protected final Vector3d up;
protected double yaw;
protected double pitch;
protected double yawOffset;
protected double pitchOffset;
protected boolean invalid;
public DirectionViewProvider () {
this (new Matrix4d (), new (), (), (DEFAULT_UP));
}
{
.matrix = matrix;
.position = position;
.direction = direction;
.up = up;
.invalid = ;
}
Vector3d {
.position;
}
DirectionViewProvider {
.setPosition(vec, , , );
}
DirectionViewProvider {
.setPosition(vec.x, vec.y, vec.z, offsetX, offsetY, offsetZ);
}
DirectionViewProvider {
.position.assign(x, y, z);
.invalid = ;
;
}
DirectionViewProvider {
.setPosition(x + offsetX, y + offsetY, z + offsetZ);
}
Vector3d {
.direction;
}
DirectionViewProvider {
.setDirection(vec.x, vec.y, vec.z);
}
DirectionViewProvider {
yaw += .yawOffset;
pitch += .pitchOffset;
.direction.assign(yaw, pitch);
.invalid = ;
;
}
DirectionViewProvider {
.direction.assign(x, y, z);
.invalid = ;
;
}
DirectionViewProvider {
.up.assign(x, y, z);
.invalid = ;
;
}
Matrix4d {
( .invalid) {
.matrix.viewDirection( .position.x, .position.y, .position.z, .direction.x, .direction.y, .direction.z, .up.x, .up.y, .up.z);
.invalid = ;
}
.matrix;
}
String {
String.valueOf( .up);
+ var10000 + + .yaw + + .pitch + + .yawOffset + + .pitchOffset + ;
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(DirectionViewProvider.class, DirectionViewProvider:: ).append( ( , Codec.DOUBLE), (projectionProvider, d) -> projectionProvider.yawOffset = d, (projectionProvider) -> projectionProvider.yawOffset).add()).append( ( , Codec.DOUBLE), (projectionProvider, d) -> projectionProvider.pitchOffset = d, (projectionProvider) -> projectionProvider.pitchOffset).add()).append( ( , Vector3d.CODEC), (projectionProvider, vec) -> projectionProvider.up.assign(vec), (projectionProvider) -> projectionProvider.up).add()).build();
DEFAULT_UP = ( , , );
}
}
com/hypixel/hytale/math/iterator/BlockIterator.java
package com.hypixel.hytale.math.iterator;
import com.hypixel.hytale.math.vector.Vector3d;
import com.hypixel.hytale.math.vector.Vector3i;
import javax.annotation.Nonnull;
public final class BlockIterator {
private BlockIterator () {
throw new UnsupportedOperationException ("This is a utilitiy class. Do not instantiate." );
}
public static boolean iterateFromTo (@Nonnull Vector3d origin, @Nonnull Vector3d target, @Nonnull BlockIteratorProcedure procedure) {
return iterateFromTo(origin.x, origin.y, origin.z, target.x, target.y, target.z, procedure);
}
public static boolean iterateFromTo (@Nonnull Vector3i origin, @Nonnull Vector3i target, @Nonnull BlockIteratorProcedure procedure) {
return iterateFromTo((double )origin.x, (double )origin.y, (double )origin.z, (double )target.x, (double )target.y, (double )target.z, procedure);
}
public static boolean iterateFromTo (double sx, sy, sz, tx, ty, tz, BlockIteratorProcedure procedure) {
tx - sx;
ty - sy;
tz - sz;
Math.sqrt(dx * dx + dy * dy + dz * dz);
iterate(sx, sy, sz, dx, dy, dz, maxDistance, procedure);
}
<T> {
tx - sx;
ty - sy;
tz - sz;
Math.sqrt(dx * dx + dy * dy + dz * dz);
iterate(sx, sy, sz, dx, dy, dz, maxDistance, procedure, t);
}
{
iterate(origin.x, origin.y, origin.z, direction.x, direction.y, direction.z, maxDistance, procedure);
}
{
checkParameters(sx, sy, sz, dx, dy, dz);
iterate0(sx, sy, sz, dx, dy, dz, maxDistance, procedure);
}
{
maxDistance /= Math.sqrt(dx * dx + dy * dy + dz * dz);
( )BlockIterator.FastMath.fastFloor(sx);
( )BlockIterator.FastMath.fastFloor(sy);
( )BlockIterator.FastMath.fastFloor(sz);
sx - ( )bx;
sy - ( )by;
sz - ( )bz;
qz;
( ; pt <= maxDistance; pz = qz) {
intersection(px, py, pz, dx, dy, dz);
px + t * dx;
py + t * dy;
qz = pz + t * dz;
(!procedure.accept(bx, by, bz, px, py, pz, qx, qy, qz)) {
;
}
(dx < && BlockIterator.FastMath.sEq(qx, )) {
++qx;
--bx;
} (dx > && BlockIterator.FastMath.gEq(qx, )) {
--qx;
++bx;
}
(dy < && BlockIterator.FastMath.sEq(qy, )) {
++qy;
--by;
} (dy > && BlockIterator.FastMath.gEq(qy, )) {
--qy;
++by;
}
(dz < && BlockIterator.FastMath.sEq(qz, )) {
++qz;
--bz;
} (dz > && BlockIterator.FastMath.gEq(qz, )) {
--qz;
++bz;
}
pt += t;
px = qx;
py = qy;
}
;
}
<T> {
checkParameters(sx, sy, sz, dx, dy, dz);
iterate0(sx, sy, sz, dx, dy, dz, maxDistance, procedure, obj1);
}
<T> {
maxDistance /= Math.sqrt(dx * dx + dy * dy + dz * dz);
( )BlockIterator.FastMath.fastFloor(sx);
( )BlockIterator.FastMath.fastFloor(sy);
( )BlockIterator.FastMath.fastFloor(sz);
sx - ( )bx;
sy - ( )by;
sz - ( )bz;
qz;
( ; pt <= maxDistance; pz = qz) {
intersection(px, py, pz, dx, dy, dz);
px + t * dx;
py + t * dy;
qz = pz + t * dz;
(!procedure.accept(bx, by, bz, px, py, pz, qx, qy, qz, obj1)) {
;
}
(dx < && BlockIterator.FastMath.sEq(qx, )) {
++qx;
--bx;
} (dx > && BlockIterator.FastMath.gEq(qx, )) {
--qx;
++bx;
}
(dy < && BlockIterator.FastMath.sEq(qy, )) {
++qy;
--by;
} (dy > && BlockIterator.FastMath.gEq(qy, )) {
--qy;
++by;
}
(dz < && BlockIterator.FastMath.sEq(qz, )) {
++qz;
--bz;
} (dz > && BlockIterator.FastMath.gEq(qz, )) {
--qz;
++bz;
}
pt += t;
px = qx;
py = qy;
}
;
}
{
(isNonValidNumber(sx)) {
( + sx);
} (isNonValidNumber(sy)) {
( + sy);
} (isNonValidNumber(sz)) {
( + sz);
} (isNonValidNumber(dx)) {
( + dx);
} (isNonValidNumber(dy)) {
( + dy);
} (isNonValidNumber(dz)) {
( + dz);
} (isZeroDirection(dx, dy, dz)) {
( + dx + + dy + + dz + );
}
}
{
Double.isNaN(d) || Double.isInfinite(d);
}
{
BlockIterator.FastMath.eq(dx, ) && BlockIterator.FastMath.eq(dy, ) && BlockIterator.FastMath.eq(dz, );
}
{
;
(dx < ) {
-px / dx;
pz + dz * t;
py + dy * t;
(t > tFar && BlockIterator.FastMath.gEq(u, ) && BlockIterator.FastMath.sEq(u, ) && BlockIterator.FastMath.gEq(v, ) && BlockIterator.FastMath.sEq(v, )) {
tFar = t;
}
} (dx > ) {
( - px) / dx;
pz + dz * t;
py + dy * t;
(t > tFar && BlockIterator.FastMath.gEq(u, ) && BlockIterator.FastMath.sEq(u, ) && BlockIterator.FastMath.gEq(v, ) && BlockIterator.FastMath.sEq(v, )) {
tFar = t;
}
}
(dy < ) {
-py / dy;
px + dx * t;
pz + dz * t;
(t > tFar && BlockIterator.FastMath.gEq(u, ) && BlockIterator.FastMath.sEq(u, ) && BlockIterator.FastMath.gEq(v, ) && BlockIterator.FastMath.sEq(v, )) {
tFar = t;
}
} (dy > ) {
( - py) / dy;
px + dx * t;
pz + dz * t;
(t > tFar && BlockIterator.FastMath.gEq(u, ) && BlockIterator.FastMath.sEq(u, ) && BlockIterator.FastMath.gEq(v, ) && BlockIterator.FastMath.sEq(v, )) {
tFar = t;
}
}
(dz < ) {
-pz / dz;
px + dx * t;
py + dy * t;
(t > tFar && BlockIterator.FastMath.gEq(u, ) && BlockIterator.FastMath.sEq(u, ) && BlockIterator.FastMath.gEq(v, ) && BlockIterator.FastMath.sEq(v, )) {
tFar = t;
}
} (dz > ) {
( - pz) / dz;
px + dx * t;
py + dy * t;
(t > tFar && BlockIterator.FastMath.gEq(u, ) && BlockIterator.FastMath.sEq(u, ) && BlockIterator.FastMath.gEq(v, ) && BlockIterator.FastMath.sEq(v, )) {
tFar = t;
}
}
tFar;
}
{
;
;
FastMath() {
}
{
abs(a - b) < ;
}
{
a <= b + ;
}
{
a >= b - ;
}
{
x < ? -x : x;
}
{
(!(x >= ) && !(x <= - )) {
( )x;
(x < && ( )y != x) {
--y;
}
y == ? ( )(x * ( )y) : y;
} {
( )x;
}
}
}
{
;
}
<T> {
;
}
}
com/hypixel/hytale/math/iterator/BoxBlockIterator.java
package com.hypixel.hytale.math.iterator;
import com.hypixel.hytale.math.shape.Box;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.math.vector.Vector3d;
import javax.annotation.Nonnull;
public final class BoxBlockIterator {
@Nonnull
private static ThreadLocal<BoxIterationBuffer> THREAD_LOCAL_BUFFER = ThreadLocal.withInitial(BoxIterationBuffer::new );
private BoxBlockIterator () {
throw new UnsupportedOperationException ("This is a utility class. Do not instantiate." );
}
public static BoxIterationBuffer getBuffer () {
return (BoxIterationBuffer)THREAD_LOCAL_BUFFER.get();
}
public static boolean iterate (@Nonnull Box box, @Nonnull Vector3d position, @Nonnull Vector3d d, double maxDistance, @Nonnull BoxIterationConsumer consumer) {
return iterate(box, position, d, maxDistance, consumer, getBuffer());
}
public static boolean iterate (@Nonnull Box box, @Nonnull Vector3d pos, Vector3d d, maxDistance, BoxIterationConsumer consumer, BoxIterationBuffer buffer) {
iterate(box.min, box.max, pos, d, maxDistance, consumer, buffer);
}
{
iterate(box, px, py, pz, dx, dy, dz, maxDistance, consumer, getBuffer());
}
{
iterate(box.min, box.max, px, py, pz, dx, dy, dz, maxDistance, consumer, buffer);
}
{
iterate(min, max, px, py, pz, dx, dy, dz, maxDistance, consumer, getBuffer());
}
{
iterate(min.x, min.y, min.z, max.x, max.y, max.z, px, py, pz, dx, dy, dz, maxDistance, consumer, buffer);
}
{
iterate(min, max, pos, d, maxDistance, consumer, getBuffer());
}
{
iterate(min.x, min.y, min.z, max.x, max.y, max.z, pos.x, pos.y, pos.z, d.x, d.y, d.z, maxDistance, consumer, buffer);
}
{
iterate(minX, minY, minZ, maxX, maxY, maxZ, px, py, pz, dx, dy, dz, maxDistance, consumer, getBuffer());
}
{
(minX > maxX) {
( + minX + + maxX);
} (minY > maxY) {
( + minY + + maxY);
} (minZ > maxZ) {
( + minZ + + maxZ);
} (consumer == ) {
( );
} (buffer == ) {
( );
} {
iterate0(minX, minY, minZ, maxX, maxY, maxZ, px, py, pz, dx, dy, dz, maxDistance, consumer, buffer);
}
}
{
buffer.consumer = consumer;
buffer.mx = maxX - minX;
buffer.my = maxY - minY;
buffer.mz = maxZ - minZ;
buffer.signX = dx > ? - : ;
buffer.signY = dy > ? - : ;
buffer.signZ = dz > ? - : ;
posX + (dx > ? maxX : minX);
posY + (dy > ? maxY : minY);
posZ + (dz > ? maxZ : minZ);
buffer.posX = ( )bx;
buffer.posY = ( )by;
buffer.posZ = ( )bz;
BlockIterator.iterate(bx, by, bz, dx, dy, dz, maxDistance, (x, y, z, px, py, pz, qx, qy, qz, buf) -> {
( )MathUtil.fastCeil((buf.signX < ? - px : px) + buf.mx);
( )MathUtil.fastCeil((buf.signY < ? - py : py) + buf.my);
( )MathUtil.fastCeil((buf.signZ < ? - pz : pz) + buf.mz);
(( )x != buf.posX) {
( ; iy < ty; ++iy) {
( ; iz < tz; ++iz) {
(!buf.consumer.accept(( )x, ( )y + ( )iy * ( )buf.signY, ( )z + ( )iz * ( )buf.signZ)) {
;
}
}
}
buf.posX = ( )x;
}
(( )y != buf.posY) {
( ; iz < tz; ++iz) {
( ; ix < tx; ++ix) {
(!buf.consumer.accept(( )x + ( )ix * ( )buf.signX, ( )y, ( )z + ( )iz * ( )buf.signZ)) {
;
}
}
}
buf.posY = ( )y;
}
(( )z != buf.posZ) {
( ; ix < tx; ++ix) {
( ; iy < ty; ++iy) {
(!buf.consumer.accept(( )x + ( )ix * ( )buf.signX, ( )y + ( )iy * ( )buf.signY, ( )z)) {
;
}
}
}
buf.posZ = ( )z;
}
buf.consumer.next();
}, buffer);
}
{
BoxIterationConsumer consumer;
mx;
my;
mz;
signX;
signY;
signZ;
posX;
posY;
posZ;
{
}
}
{
;
;
}
}
com/hypixel/hytale/math/iterator/CircleIterator.java
package com.hypixel.hytale.math.iterator;
import com.hypixel.hytale.math.util.TrigMathUtil;
import com.hypixel.hytale.math.vector.Vector3d;
import java.util.Iterator;
import javax.annotation.Nonnull;
public class CircleIterator implements Iterator <Vector3d> {
private final Vector3d origin;
private final int pointTotal;
private final double radius;
private final float angleOffset;
private int pointIndex;
public CircleIterator (Vector3d origin, double radius, int pointTotal) {
this (origin, radius, pointTotal, 0.0F );
}
public CircleIterator (Vector3d origin, double radius, int pointTotal, float angleOffset) {
this .origin = origin;
this .pointTotal = pointTotal;
this .angleOffset = angleOffset;
this .pointIndex = 0 ;
this .radius = radius;
}
public boolean hasNext {
.pointIndex < .pointTotal;
}
Vector3d {
++ .pointIndex;
( ) .pointIndex / ( ) .pointTotal * + .angleOffset;
(( )TrigMathUtil.cos(angle) * .radius + .origin.getX(), .origin.getY(), ( )TrigMathUtil.sin(angle) * .radius + .origin.getZ());
}
}
com/hypixel/hytale/math/iterator/CircleSpiralIterator.java
package com.hypixel.hytale.math.iterator;
import com.hypixel.hytale.math.util.ChunkUtil;
import com.hypixel.hytale.math.util.MathUtil;
import java.util.NoSuchElementException;
public class CircleSpiralIterator {
public static final long MAX_RADIUS_LONG = (long )Math.sqrt(9.223372036854776E18 ) / 2L - 1L ;
public static final int MAX_RADIUS;
private boolean setup;
private int chunkX;
private int chunkZ;
private long maxI;
private long i;
private int x;
private int z;
private int dx;
private int dz;
private long radiusFromSq;
private long radiusToSq;
private boolean hasNext;
private long nextChunk;
public CircleSpiralIterator {
}
{
.init(chunkX, chunkZ, , radiusTo);
}
{
(radiusFrom < ) {
( + radiusFrom);
} (radiusTo <= ) {
( + radiusTo);
} (radiusTo > MAX_RADIUS) {
( + MAX_RADIUS + + radiusTo);
} (radiusFrom >= radiusTo) {
( + radiusFrom + + radiusTo);
} {
.chunkX = chunkX;
.chunkZ = chunkZ;
.radiusFromSq = ( )radiusFrom * ( )radiusFrom;
.radiusToSq = ( )radiusTo * ( )radiusTo;
+ ( )radiusTo * ;
.maxI = widthTo * widthTo;
(radiusFrom != ) {
( )radiusFrom / ;
halfFrom * halfFrom;
( )Math.sqrt(( )(sq + sq));
+ ( )diagRadius * ;
.i = widthFrom * widthFrom;
SpiralIterator.getPosFromIndex(( ) .i);
.x = ChunkUtil.xOfChunkIndex(pos);
.z = ChunkUtil.zOfChunkIndex(pos);
.dx = ;
.dz = ;
} {
.i = ;
.x = .z = ;
.dx = ;
.dz = - ;
}
.hasNext = ;
.prepareNext();
.setup = ;
}
}
{
.setup = ;
.hasNext = ;
}
{
(! .setup) {
( );
} {
(! .hasNext) {
.prepareNext();
}
(! .hasNext) {
( );
} {
.hasNext = ;
.nextChunk;
}
}
}
{
(! .setup) {
( );
} {
(! .hasNext) {
.prepareNext();
}
.hasNext;
}
}
{
MathUtil.ceil((Math.sqrt(( ) .i) - ) / );
}
{
( )((Math.sqrt(( ) .i) - ) / );
}
{
(! .hasNext && .i < .maxI) {
( ) .x;
( ) .z;
rx * rx + rz * rz;
(radiusSq >= .radiusFromSq && radiusSq <= .radiusToSq) {
.nextChunk = ChunkUtil.indexChunk( .chunkX + .x, .chunkZ + .z);
.hasNext = ;
}
( .x == .z || .x < && .x == - .z || .x > && .x == - .z) {
.dx;
.dx = - .dz;
.dz = tempDx;
}
.x += .dx;
.z += .dz;
++ .i;
}
}
{
MAX_RADIUS = ( )MAX_RADIUS_LONG;
}
}
com/hypixel/hytale/math/iterator/LineIterator.java
package com.hypixel.hytale.math.iterator;
import com.hypixel.hytale.math.vector.Vector3i;
import java.util.Iterator;
import java.util.NoSuchElementException;
import javax.annotation.Nonnull;
public class LineIterator implements Iterator <Vector3i> {
private final int x_inc;
private final int y_inc;
private final int z_inc;
private final int l;
private final int m;
private final int n;
private final int dx2;
private final int dy2;
private final int dz2;
private int i;
private int err1;
private int err2;
private int pointX;
private int pointY;
private int pointZ;
public {
.pointX = x1;
.pointY = y1;
.pointZ = z1;
x2 - x1;
y2 - y1;
z2 - z1;
.x_inc = dx < ? - : ;
.y_inc = dy < ? - : ;
.z_inc = dz < ? - : ;
.l = Math.abs(dx);
.m = Math.abs(dy);
.n = Math.abs(dz);
.dx2 = .l << ;
.dy2 = .m << ;
.dz2 = .n << ;
( .l >= .m && .l >= .n) {
.err1 = .dy2 - .l;
.err2 = .dz2 - .l;
} ( .m >= .l && .m >= .n) {
.err1 = .dx2 - .m;
.err2 = .dz2 - .m;
} {
.err1 = .dx2 - .n;
.err2 = .dy2 - .n;
}
}
{
( .l >= .m && .l >= .n) {
.i <= .l;
} ( .m >= .l && .m >= .n) {
.i <= .m;
} {
.i <= .n;
}
}
Vector3i {
( .l >= .m && .l >= .n) {
( .i == .l) {
++ .i;
( .pointX, .pointY, .pointZ);
} ( .i > .l) {
();
} {
( .pointX, .pointY, .pointZ);
.pointX += .x_inc;
( .err1 > ) {
.pointY += .y_inc;
.err1 -= .dx2;
}
.err1 += .dy2;
( .err2 > ) {
.pointZ += .z_inc;
.err2 -= .dx2;
}
.err2 += .dz2;
++ .i;
vector3i;
}
} ( .m >= .l && .m >= .n) {
( .i == .m) {
++ .i;
( .pointX, .pointY, .pointZ);
} ( .i > .m) {
();
} {
( .pointX, .pointY, .pointZ);
( .err1 > ) {
.pointX += .x_inc;
.err1 -= .dy2;
}
.err1 += .dx2;
.pointY += .y_inc;
( .err2 > ) {
.pointZ += .z_inc;
.err2 -= .dy2;
}
.err2 += .dz2;
++ .i;
vector3i;
}
} ( .i == .n) {
++ .i;
( .pointX, .pointY, .pointZ);
} ( .i > .n) {
();
} {
( .pointX, .pointY, .pointZ);
( .err1 > ) {
.pointX += .x_inc;
.err1 -= .dz2;
}
.err1 += .dx2;
( .err2 > ) {
.pointY += .y_inc;
.err2 -= .dz2;
}
.err2 += .dy2;
.pointZ += .z_inc;
++ .i;
vector3i;
}
}
}
com/hypixel/hytale/math/iterator/SpiralIterator.java
package com.hypixel.hytale.math.iterator;
import com.hypixel.hytale.math.util.ChunkUtil;
import com.hypixel.hytale.math.util.MathUtil;
public class SpiralIterator {
public static final long MAX_RADIUS_LONG = (long )Math.sqrt(9.223372036854776E18 ) / 2L - 1L ;
public static final int MAX_RADIUS;
private boolean setup;
private int chunkX;
private int chunkZ;
private long maxI;
private long i;
private int x;
private int z;
private int dx;
private int dz;
public SpiralIterator () {
}
public SpiralIterator (int chunkX, int chunkZ, int radius) {
this .init(chunkX, chunkZ, radius);
}
public SpiralIterator {
.init(chunkX, chunkZ, radiusFrom, radiusTo);
}
{
.init(chunkX, chunkZ, , radiusTo);
}
{
(radiusFrom < ) {
( + radiusFrom);
} (radiusTo <= ) {
( + radiusTo);
} (radiusTo > MAX_RADIUS) {
( + MAX_RADIUS + + radiusTo);
} (radiusFrom >= radiusTo) {
( + radiusFrom + + radiusTo);
} {
.chunkX = chunkX;
.chunkZ = chunkZ;
+ ( )radiusTo * ;
.maxI = widthTo * widthTo;
(radiusFrom != ) {
+ ( )radiusFrom * ;
.i = widthFrom * widthFrom;
getPosFromIndex(( ) .i);
.x = ChunkUtil.xOfChunkIndex(pos);
.z = ChunkUtil.zOfChunkIndex(pos);
.dx = ;
.dz = ;
} {
.i = ;
.x = .z = ;
.dx = ;
.dz = - ;
}
.setup = ;
}
}
{
.setup = ;
}
{
(! .setup) {
( );
} {
ChunkUtil.indexChunk( .chunkX + .x, .chunkZ + .z);
( .x == .z || .x < && .x == - .z || .x > && .x == - .z) {
.dx;
.dx = - .dz;
.dz = tempDx;
}
.x += .dx;
.z += .dz;
++ .i;
chunkCoordinates;
}
}
{
.i < .maxI;
}
{
.setup;
}
{
.i;
}
{
.maxI;
}
{
.chunkX;
}
{
.chunkZ;
}
{
.x;
}
{
.z;
}
{
.dx;
}
{
.dz;
}
{
MathUtil.ceil((Math.sqrt(( ) .i) - ) / );
}
{
( )((Math.sqrt(( ) .i) - ) / );
}
{
(index < ) {
( );
} {
++index;
MathUtil.ceil((Math.sqrt(( )index) - ) / );
* k;
( )Math.pow(( )( + t), );
m - t;
(index < m1) {
m1 - t;
(index < m2) {
index >= m2 - t ? ChunkUtil.indexChunk(-k + (m2 - index), k) : ChunkUtil.indexChunk(k, k - (m2 - index - t));
} {
ChunkUtil.indexChunk(-k, -k + (m1 - index));
}
} {
ChunkUtil.indexChunk(k - (m - index), -k);
}
}
}
{
MAX_RADIUS = ( )MAX_RADIUS_LONG;
}
}
com/hypixel/hytale/math/matrix/Matrix4d.java
package com.hypixel.hytale.math.matrix;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.math.util.TrigMathUtil;
import com.hypixel.hytale.math.vector.Vector3d;
import com.hypixel.hytale.math.vector.Vector4d;
import java.util.Arrays;
import javax.annotation.Nonnull;
public class Matrix4d {
public static final int M00 = 0 ;
public static final int M10 = 4 ;
public static final int M20 = 8 ;
public static final int M30 = 12 ;
public static final int M01 = 1 ;
public static final int M11 = 5 ;
;
;
;
;
;
;
;
;
;
;
;
;
;
[] m;
{
( [ ]);
}
{
();
.assign(other);
}
{
.m = m;
}
{
.m[idx];
}
{
.get(idx(col, row));
}
Matrix4d {
.m[idx] = val;
;
}
Matrix4d {
.set(idx(col, row), val);
}
Matrix4d {
[] var10000 = .m;
var10000[idx] += val;
;
}
Matrix4d {
.set(idx(col, row), val);
}
Matrix4d {
Arrays.fill( .m, );
( ; i < ; i += ) {
.m[i] = ;
}
;
}
Matrix4d {
System.arraycopy(other.m, , .m, , );
;
}
Matrix4d {
.m[ ] = m00;
.m[ ] = m01;
.m[ ] = m02;
.m[ ] = m03;
.m[ ] = m10;
.m[ ] = m11;
.m[ ] = m12;
.m[ ] = m13;
.m[ ] = m20;
.m[ ] = m21;
.m[ ] = m22;
.m[ ] = m23;
.m[ ] = m30;
.m[ ] = m31;
.m[ ] = m32;
.m[ ] = m33;
;
}
Matrix4d {
.translate(vec.x, vec.y, vec.z);
}
Matrix4d {
( ; i < ; ++i) {
[] var10000 = .m;
var10000[i + ] += .m[i] * x + .m[i + ] * y + .m[i + ] * z;
}
;
}
Matrix4d {
( ; i < ; ++i) {
[] var10000 = .m;
var10000[i] *= x;
var10000 = .m;
var10000[i + ] *= y;
var10000 = .m;
var10000[i + ] *= z;
}
;
}
Vector3d {
.multiplyPosition(vec, vec);
}
Vector3d {
.m[ ] * vec.x + .m[ ] * vec.y + .m[ ] * vec.z + .m[ ];
.m[ ] * vec.x + .m[ ] * vec.y + .m[ ] * vec.z + .m[ ];
.m[ ] * vec.x + .m[ ] * vec.y + .m[ ] * vec.z + .m[ ];
.m[ ] * vec.x + .m[ ] * vec.y + .m[ ] * vec.z + .m[ ];
/ w;
result.assign(x * invW, y * invW, z * invW);
result;
}
Vector3d {
.m[ ] * vec.x + .m[ ] * vec.y + .m[ ] * vec.z;
.m[ ] * vec.x + .m[ ] * vec.y + .m[ ] * vec.z;
.m[ ] * vec.x + .m[ ] * vec.y + .m[ ] * vec.z;
vec.assign(x, y, z);
vec;
}
Vector4d {
.multiply(vec, vec);
}
Vector4d {
.m[ ] * vec.x + .m[ ] * vec.y + .m[ ] * vec.z + .m[ ] * vec.w;
.m[ ] * vec.x + .m[ ] * vec.y + .m[ ] * vec.z + .m[ ] * vec.w;
.m[ ] * vec.x + .m[ ] * vec.y + .m[ ] * vec.z + .m[ ] * vec.w;
.m[ ] * vec.x + .m[ ] * vec.y + .m[ ] * vec.z + .m[ ] * vec.w;
result.assign(x, y, z, w);
result;
}
Matrix4d {
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
other.m[ ];
other.m[ ];
other.m[ ];
other.m[ ];
other.m[ ];
other.m[ ];
other.m[ ];
other.m[ ];
other.m[ ];
other.m[ ];
other.m[ ];
other.m[ ];
other.m[ ];
other.m[ ];
other.m[ ];
other.m[ ];
.m[ ] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03;
.m[ ] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03;
.m[ ] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03;
.m[ ] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03;
.m[ ] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13;
.m[ ] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13;
.m[ ] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13;
.m[ ] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13;
.m[ ] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23;
.m[ ] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23;
.m[ ] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23;
.m[ ] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23;
.m[ ] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33;
.m[ ] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33;
.m[ ] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33;
.m[ ] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;
;
}
{
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
.m[ ];
src10 * src15;
src11 * src14;
src9 * src15;
src11 * src13;
src9 * src14;
src10 * src13;
src8 * src15;
src11 * src12;
src8 * src14;
src10 * src12;
src8 * src13;
src9 * src12;
atmp0 * src5 + atmp3 * src6 + atmp4 * src7 - (atmp1 * src5 + atmp2 * src6 + atmp5 * src7);
atmp1 * src4 + atmp6 * src6 + atmp9 * src7 - (atmp0 * src4 + atmp7 * src6 + atmp8 * src7);
atmp2 * src4 + atmp7 * src5 + atmp10 * src7 - (atmp3 * src4 + atmp6 * src5 + atmp11 * src7);
atmp5 * src4 + atmp8 * src5 + atmp11 * src6 - (atmp4 * src4 + atmp9 * src5 + atmp10 * src6);
atmp1 * src1 + atmp2 * src2 + atmp5 * src3 - (atmp0 * src1 + atmp3 * src2 + atmp4 * src3);
atmp0 * src0 + atmp7 * src2 + atmp8 * src3 - (atmp1 * src0 + atmp6 * src2 + atmp9 * src3);
atmp3 * src0 + atmp6 * src1 + atmp11 * src3 - (atmp2 * src0 + atmp7 * src1 + atmp10 * src3);
atmp4 * src0 + atmp9 * src1 + atmp10 * src2 - (atmp5 * src0 + atmp8 * src1 + atmp11 * src2);
src2 * src7;
src3 * src6;
src1 * src7;
src3 * src5;
src1 * src6;
src2 * src5;
src0 * src7;
src3 * src4;
src0 * src6;
src2 * src4;
src0 * src5;
src1 * src4;
btmp0 * src13 + btmp3 * src14 + btmp4 * src15 - (btmp1 * src13 + btmp2 * src14 + btmp5 * src15);
btmp1 * src12 + btmp6 * src14 + btmp9 * src15 - (btmp0 * src12 + btmp7 * src14 + btmp8 * src15);
btmp2 * src12 + btmp7 * src13 + btmp10 * src15 - (btmp3 * src12 + btmp6 * src13 + btmp11 * src15);
btmp5 * src12 + btmp8 * src13 + btmp11 * src14 - (btmp4 * src12 + btmp9 * src13 + btmp10 * src14);
btmp2 * src10 + btmp5 * src11 + btmp1 * src9 - (btmp4 * src11 + btmp0 * src9 + btmp3 * src10);
btmp8 * src11 + btmp0 * src8 + btmp7 * src10 - (btmp6 * src10 + btmp9 * src11 + btmp1 * src8);
btmp6 * src9 + btmp11 * src11 + btmp3 * src8 - (btmp10 * src11 + btmp2 * src8 + btmp7 * src9);
btmp10 * src10 + btmp4 * src8 + btmp9 * src9 - (btmp8 * src9 + btmp11 * src10 + btmp5 * src8);
src0 * dst0 + src1 * dst1 + src2 * dst2 + src3 * dst3;
(det == ) {
;
} {
/ det;
.m[ ] = dst0 * invdet;
.m[ ] = dst1 * invdet;
.m[ ] = dst2 * invdet;
.m[ ] = dst3 * invdet;
.m[ ] = dst4 * invdet;
.m[ ] = dst5 * invdet;
.m[ ] = dst6 * invdet;
.m[ ] = dst7 * invdet;
.m[ ] = dst8 * invdet;
.m[ ] = dst9 * invdet;
.m[ ] = dst10 * invdet;
.m[ ] = dst11 * invdet;
.m[ ] = dst12 * invdet;
.m[ ] = dst13 * invdet;
.m[ ] = dst14 * invdet;
.m[ ] = dst15 * invdet;
;
}
}
Matrix4d {
/ (right + left);
/ (top + bottom);
- / (far - near);
* r_width;
* r_height;
* r_depth;
.m[ ] = .m[ ] = .m[ ] = ;
.m[ ] = .m[ ] = .m[ ] = ;
.m[ ] = .m[ ] = .m[ ] = ;
.m[ ] = ;
.m[ ] = x;
.m[ ] = y;
.m[ ] = z;
.m[ ] = -(right - left) * r_width;
.m[ ] = -(top - bottom) * r_height;
.m[ ] = (far + near) * r_depth;
;
}
Matrix4d {
/ (right + left);
/ (top + bottom);
/ (near - far);
.m[ ] = .m[ ] = .m[ ] = ;
.m[ ] = .m[ ] = .m[ ] = ;
.m[ ] = .m[ ] = .m[ ] = ;
.m[ ] = - ;
.m[ ] = * near * r_width;
.m[ ] = * near * r_height;
.m[ ] = * far * near * r_depth;
.m[ ] = * (right - left) * r_width;
.m[ ] = (top - bottom) * r_height;
.m[ ] = (far + near) * r_depth;
;
}
Matrix4d {
/ Math.tan(fov * );
/ (near - far);
.m[ ] = f / aspect;
.m[ ] = .m[ ] = .m[ ] = ;
.m[ ] = f;
.m[ ] = .m[ ] = .m[ ] = ;
.m[ ] = .m[ ] = ;
.m[ ] = (far + near) * r;
.m[ ] = - ;
.m[ ] = .m[ ] = .m[ ] = ;
.m[ ] = * far * near * r;
;
}
Matrix4d {
centerX - eyeX;
centerY - eyeY;
centerZ - eyeZ;
.viewDirection(eyeX, eyeY, eyeZ, dirX, dirY, dirZ, upX, upY, upZ);
}
Matrix4d {
/ MathUtil.length(dirX, dirY, dirZ);
dirX *= rlf;
dirY *= rlf;
dirZ *= rlf;
dirY * upZ - dirZ * upY;
dirZ * upX - dirX * upZ;
dirX * upY - dirY * upX;
/ MathUtil.length(sx, sy, sz);
sx *= rls;
sy *= rls;
sz *= rls;
sy * dirZ - sz * dirY;
sz * dirX - sx * dirZ;
sx * dirY - sy * dirX;
.m[ ] = sx;
.m[ ] = ux;
.m[ ] = -dirX;
.m[ ] = ;
.m[ ] = sy;
.m[ ] = uy;
.m[ ] = -dirY;
.m[ ] = ;
.m[ ] = sz;
.m[ ] = uz;
.m[ ] = -dirZ;
.m[ ] = ;
.m[ ] = ;
.m[ ] = ;
.m[ ] = ;
.m[ ] = ;
.translate(-eyeX, -eyeY, -eyeZ);
;
}
Matrix4d {
.multiply(tmp.setRotateAxis(a, x, y, z));
}
Matrix4d {
( )TrigMathUtil.sin(a);
( )TrigMathUtil.cos(a);
.m[ ] = cos + x * x * ( - cos);
.m[ ] = x * y * ( - cos) - z * sin;
.m[ ] = x * z * ( - cos) + y * sin;
.m[ ] = ;
.m[ ] = y * x * ( - cos) + z * sin;
.m[ ] = cos + y * y * ( - cos);
.m[ ] = y * z * ( - cos) - x * sin;
.m[ ] = ;
.m[ ] = z * x * ( - cos) - y * sin;
.m[ ] = z * y * ( - cos) + x * sin;
.m[ ] = cos + z * z * ( - cos);
.m[ ] = ;
.m[ ] = ;
.m[ ] = ;
.m[ ] = ;
.m[ ] = ;
;
}
Matrix4d {
.multiply(tmp.setRotateEuler(x, y, z));
}
Matrix4d {
( )TrigMathUtil.cos(x);
( )TrigMathUtil.sin(x);
( )TrigMathUtil.cos(y);
( )TrigMathUtil.sin(y);
( )TrigMathUtil.cos(z);
( )TrigMathUtil.sin(z);
cx * sy;
sx * sy;
.m[ ] = cy * cz;
.m[ ] = -cy * sz;
.m[ ] = sy;
.m[ ] = sxsy * cz + cx * sz;
.m[ ] = -sxsy * sz + cx * cz;
.m[ ] = -sx * cy;
.m[ ] = -cxsy * cz + sx * sz;
.m[ ] = cxsy * sz + sx * cz;
.m[ ] = cx * cy;
.m[ ] = .m[ ] = .m[ ] = ;
.m[ ] = .m[ ] = .m[ ] = ;
.m[ ] = ;
;
}
[] getData() {
.m;
}
[] asFloatData() {
[] data = [ ];
( ; i < ; ++i) {
data[i] = ( ) .m[i];
}
data;
}
String {
.m[ ];
+ var10000 + + .m[ ] + + .m[ ] + + .m[ ] + + .m[ ] + + .m[ ] + + .m[ ] + + .m[ ] + + .m[ ] + + .m[ ] + + .m[ ] + + .m[ ] + + .m[ ] + + .m[ ] + + .m[ ] + + .m[ ] + ;
}
{
col << | row;
}
}
com/hypixel/hytale/math/random/RandomExtra.java
package com.hypixel.hytale.math.random;
import com.hypixel.hytale.function.function.TriFunction;
import com.hypixel.hytale.math.vector.Vector3d;
import java.time.Duration;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import java.util.function.BiPredicate;
import java.util.function.Predicate;
import java.util.function.ToDoubleBiFunction;
import java.util.function.ToDoubleFunction;
import java.util.function.ToIntFunction;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public final class RandomExtra {
private RandomExtra () {
}
public static double randomBinomial () {
ThreadLocalRandom random = ThreadLocalRandom.current();
double a = random.nextDouble();
double b = random.nextDouble();
return a - b;
}
public static double randomRange (@Nonnull double [] range) {
randomRange(range[ ], range[ ]);
}
{
from + ThreadLocalRandom.current().nextDouble() * (to - from);
}
{
randomRange(range[ ], range[ ]);
}
{
from + ThreadLocalRandom.current().nextFloat() * (to - from);
}
{
ThreadLocalRandom.current().nextInt(bound);
}
{
randomRange(range[ ], range[ ]);
}
{
ThreadLocalRandom.current().nextInt(to - from + ) + from;
}
{
ThreadLocalRandom.current().nextLong(to - from + ) + from;
}
Duration {
Duration.ofNanos(randomRange(from.toNanos(), to.toNanos()));
}
{
ThreadLocalRandom.current().nextBoolean();
}
<T> T {
(T)collection.get(randomRange(collection.size()));
}
Vector3d {
ThreadLocalRandom.current();
vec.x += current.nextDouble() * maxRange;
vec.y += current.nextDouble() * maxRange;
vec.z += current.nextDouble() * maxRange;
vec;
}
<T> T {
Iterator<? > i = elements.iterator();
sumWeights;
(sumWeights = ; i.hasNext(); sumWeights += weight.applyAsDouble(i.next())) {
}
(T)randomWeightedElement(elements, weight, sumWeights);
}
<T> T {
(sumWeights == ) {
;
} {
Iterator<? > i = elements.iterator();
;
sumWeights *= ThreadLocalRandom.current().nextDouble();
(i.hasNext()) {
result = (T)i.next();
sumWeights -= weight.applyAsDouble(result);
(sumWeights < ) {
;
}
}
result;
}
}
<T> T {
Iterator<? > i = elements.iterator();
sumWeights;
(sumWeights = ; i.hasNext(); sumWeights += weight.applyAsInt(i.next())) {
}
(T)randomIntWeightedElement(elements, weight, sumWeights);
}
<T> T {
(sumWeights == ) {
;
} {
Iterator<? > i = elements.iterator();
;
sumWeights = randomRange(sumWeights);
(i.hasNext()) {
result = (T)i.next();
sumWeights -= weight.applyAsInt(result);
(sumWeights < ) {
;
}
}
result;
}
}
<T> T {
Iterator<? > i = elements.iterator();
;
(i.hasNext()) {
(T)i.next();
(filter.test(t)) {
sumWeights += weight.applyAsInt(t);
}
}
(T)randomWeightedElementFiltered(elements, filter, weight, sumWeights);
}
<T> T {
(sumWeights == ) {
;
} {
Iterator<? > i = elements.iterator();
;
sumWeights = randomRange(sumWeights);
(i.hasNext()) {
result = (T)i.next();
(filter.test(result)) {
sumWeights -= weight.applyAsInt(result);
(sumWeights < ) {
;
}
}
}
result;
}
}
<T> T {
Iterator<? > i = elements.iterator();
;
(i.hasNext()) {
(T)i.next();
(filter.test(t)) {
sumWeights += weight.applyAsDouble(t);
}
}
(T)randomWeightedElement(elements, filter, weight, sumWeights);
}
<T> T {
(sumWeights == ) {
;
} {
Iterator<? > i = elements.iterator();
;
sumWeights *= ThreadLocalRandom.current().nextDouble();
(i.hasNext()) {
result = (T)i.next();
(filter.test(result)) {
sumWeights -= weight.applyAsDouble(result);
(sumWeights < ) {
;
}
}
}
result;
}
}
<T, U> T {
(sumWeights == ) {
;
} {
Iterator<? > i = elements.iterator();
;
sumWeights *= ThreadLocalRandom.current().nextDouble();
(i.hasNext()) {
result = (T)i.next();
(filter.test(result, meta)) {
sumWeights -= weight.applyAsDouble(result, meta);
(sumWeights < ) {
;
}
}
}
result;
}
}
<T> {
;
( ; i < input.size(); ++i) {
(T)input.get(i);
(matcher.test(element)) {
(selected < count) {
picked.add(element);
} {
randomRange(selected + );
(j < count) {
picked.set(j, element);
}
}
++selected;
}
}
}
<E, S <E>, F, T <F>, G, H> {
;
( ; i < input.size(); ++i) {
filter.apply(input.get(i), g, h);
(f != ) {
(selected < count) {
picked.add(f);
} {
randomRange(selected + );
(j < count) {
picked.set(j, f);
}
}
++selected;
}
}
}
<E, T <E>> {
(picked.size() < count) {
picked.add(element);
} {
randomRange(count + );
(i < count) {
picked.set(i, element);
}
}
}
{
;
( weight : weights) {
sum += weight;
}
ThreadLocalRandom.current().nextDouble(sum);
( ; i < weights.length - ; ++i) {
randomWeight -= weights[i];
(randomWeight <= ) {
i;
}
}
weights.length - ;
}
}
com/hypixel/hytale/math/range/FloatRange.java
package com.hypixel.hytale.math.range;
import com.hypixel.hytale.math.codec.FloatRangeArrayCodec;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class FloatRange {
public static final FloatRangeArrayCodec CODEC = new FloatRangeArrayCodec ();
private float inclusiveMin;
private float inclusiveMax;
private float range;
public FloatRange () {
this (0.0F , 0.0F );
}
public FloatRange (float inclusiveMin, float inclusiveMax) {
this .inclusiveMin = inclusiveMin;
this .inclusiveMax = inclusiveMax;
this .range = inclusiveMax - inclusiveMin + 1.0F ;
}
public float getInclusiveMin () {
return this .inclusiveMin;
}
public float getInclusiveMax () {
return .inclusiveMax;
}
{
.inclusiveMin = inclusiveMin;
.range = .inclusiveMax - inclusiveMin + ;
}
{
.inclusiveMax = inclusiveMax;
.range = inclusiveMax - .inclusiveMin + ;
}
{
.inclusiveMin + .range * factor;
Float.min( .inclusiveMax, value);
}
{
.inclusiveMin + ( )(( ) .range * factor);
Float.min( .inclusiveMax, value);
}
{
value >= .inclusiveMin && value <= .inclusiveMax;
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(FloatRange)o;
(Float.compare(that.inclusiveMin, .inclusiveMin) != ) {
;
} (Float.compare(that.inclusiveMax, .inclusiveMax) != ) {
;
} {
Float.compare(that.range, .range) == ;
}
} {
;
}
}
{
.inclusiveMin != ? Float.floatToIntBits( .inclusiveMin) : ;
result = * result + ( .inclusiveMax != ? Float.floatToIntBits( .inclusiveMax) : );
result = * result + ( .range != ? Float.floatToIntBits( .range) : );
result;
}
String {
+ .inclusiveMin + + .inclusiveMax + ;
}
}
com/hypixel/hytale/math/range/IntRange.java
package com.hypixel.hytale.math.range;
import com.hypixel.hytale.math.codec.IntRangeArrayCodec;
import com.hypixel.hytale.math.util.MathUtil;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class IntRange {
public static final IntRangeArrayCodec CODEC = new IntRangeArrayCodec ();
private int inclusiveMin;
private int inclusiveMax;
private int range;
public IntRange () {
this (0 , 0 );
}
public IntRange (int inclusiveMin, int inclusiveMax) {
this .inclusiveMin = inclusiveMin;
this .inclusiveMax = inclusiveMax;
this .range = inclusiveMax - inclusiveMin + 1 ;
}
public int getInclusiveMin () {
return this .inclusiveMin;
}
public int getInclusiveMax () {
.inclusiveMax;
}
{
.inclusiveMin = inclusiveMin;
.range = .inclusiveMax - inclusiveMin + ;
}
{
.inclusiveMax = inclusiveMax;
.range = inclusiveMax - .inclusiveMin + ;
}
{
.inclusiveMin + MathUtil.fastFloor(( ) .range * factor);
Integer.min( .inclusiveMax, value);
}
{
.inclusiveMin + MathUtil.floor(( ) .range * factor);
Integer.min( .inclusiveMax, value);
}
{
value >= .inclusiveMin && value <= .inclusiveMax;
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(IntRange)o;
( .inclusiveMin != intRange.inclusiveMin) {
;
} {
.inclusiveMax == intRange.inclusiveMax;
}
} {
;
}
}
{
.inclusiveMin;
result = * result + .inclusiveMax;
result;
}
String {
+ .inclusiveMin + + .inclusiveMax + ;
}
}
com/hypixel/hytale/math/range/IntRangeBoundValidator.java
package com.hypixel.hytale.math.range;
import com.hypixel.hytale.codec.schema.SchemaContext;
import com.hypixel.hytale.codec.schema.config.ArraySchema;
import com.hypixel.hytale.codec.schema.config.IntegerSchema;
import com.hypixel.hytale.codec.schema.config.Schema;
import com.hypixel.hytale.codec.validation.ValidationResults;
import com.hypixel.hytale.codec.validation.Validator;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class IntRangeBoundValidator implements Validator <IntRange> {
private final Integer min;
private final Integer max;
private final boolean inclusive;
private final boolean lowerBound;
@Nonnull
public static IntRangeBoundValidator lowerBound (Integer min, Integer max, boolean inclusive) {
return new IntRangeBoundValidator (min, max, inclusive, true );
}
@Nonnull
public static IntRangeBoundValidator upperBound (Integer min, Integer max, boolean inclusive) {
return new (min, max, inclusive, );
}
{
.min = min;
.max = max;
.inclusive = inclusive;
.lowerBound = lowerBound;
}
{
(intRange != ) {
( .lowerBound) {
.validateBound(intRange.getInclusiveMin(), , results);
} {
.validateBound(intRange.getInclusiveMax(), , results);
}
}
}
{
( .min != ) {
( .inclusive) {
(value < .min) {
results.fail(boundName + + .min);
}
} (value <= .min) {
results.fail(boundName + + .min);
}
}
( .max != ) {
( .inclusive) {
(value > .max) {
results.fail(boundName + + .max);
}
} (value >= .max) {
results.fail(boundName + + .max);
}
}
}
{
(target ArraySchema arraySchema) {
Schema[] items = (Schema[])arraySchema.getItems();
(items == ) {
();
} {
( .lowerBound) {
(!(items[ ] IntegerSchema)) {
();
}
.updateSchemaBound((IntegerSchema)items[ ]);
} {
(!(items[ ] IntegerSchema)) {
();
}
.updateSchemaBound((IntegerSchema)items[ ]);
}
}
} {
();
}
}
{
( .min != ) {
( .inclusive) {
integerSchema.setMinimum( .min);
} {
integerSchema.setExclusiveMinimum( .min);
}
}
( .max != ) {
( .inclusive) {
integerSchema.setMaximum( .max);
} {
integerSchema.setExclusiveMaximum( .max);
}
}
}
}
com/hypixel/hytale/math/raycast/RaycastAABB.java
package com.hypixel.hytale.math.raycast;
import javax.annotation.Nonnull;
public class RaycastAABB {
public static final double EPSILON = -1.0E-8 ;
public RaycastAABB () {
}
public static double intersect (double minX, double minY, double minZ, double maxX, double maxY, double maxZ, double ox, double oy, double oz, double dx, double dy, double dz) {
double tNear = 1.0 / 0.0 ;
double t = (minX - ox) / dx;
if (t < tNear && t > -1.0E-8 ) {
double u = oz + dz * t;
double v = oy + dy * t;
if (u >= minZ && u <= maxZ && v >= minY && v <= maxY) {
tNear = t;
}
}
t = (maxX - ox) / dx;
if (t < tNear && t > - ) {
oz + dz * t;
oy + dy * t;
(u >= minZ && u <= maxZ && v >= minY && v <= maxY) {
tNear = t;
}
}
t = (minY - oy) / dy;
(t < tNear && t > - ) {
ox + dx * t;
oz + dz * t;
(u >= minX && u <= maxX && v >= minZ && v <= maxZ) {
tNear = t;
}
}
t = (maxY - oy) / dy;
(t < tNear && t > - ) {
ox + dx * t;
oz + dz * t;
(u >= minX && u <= maxX && v >= minZ && v <= maxZ) {
tNear = t;
}
}
t = (minZ - oz) / dz;
(t < tNear && t > - ) {
ox + dx * t;
oy + dy * t;
(u >= minX && u <= maxX && v >= minY && v <= maxY) {
tNear = t;
}
}
t = (maxZ - oz) / dz;
(t < tNear && t > - ) {
ox + dx * t;
oy + dy * t;
(u >= minX && u <= maxX && v >= minY && v <= maxY) {
tNear = t;
}
}
tNear;
}
{
/ ;
;
;
;
(minX - ox) / dx;
(t < tNear && t > - ) {
oz + dz * t;
oy + dy * t;
(u >= minZ && u <= maxZ && v >= minY && v <= maxY) {
tNear = t;
nx = - ;
}
}
t = (maxX - ox) / dx;
(t < tNear && t > - ) {
oz + dz * t;
oy + dy * t;
(u >= minZ && u <= maxZ && v >= minY && v <= maxY) {
tNear = t;
nx = ;
}
}
t = (minY - oy) / dy;
(t < tNear && t > - ) {
ox + dx * t;
oz + dz * t;
(u >= minX && u <= maxX && v >= minZ && v <= maxZ) {
tNear = t;
ny = - ;
}
}
t = (maxY - oy) / dy;
(t < tNear && t > - ) {
ox + dx * t;
oz + dz * t;
(u >= minX && u <= maxX && v >= minZ && v <= maxZ) {
tNear = t;
ny = ;
}
}
t = (minZ - oz) / dz;
(t < tNear && t > - ) {
ox + dx * t;
oy + dy * t;
(u >= minX && u <= maxX && v >= minY && v <= maxY) {
tNear = t;
nz = - ;
}
}
t = (maxZ - oz) / dz;
(t < tNear && t > - ) {
ox + dx * t;
oy + dy * t;
(u >= minX && u <= maxX && v >= minY && v <= maxY) {
tNear = t;
nz = ;
}
}
consumer.accept(tNear != / , ox, oy, oz, dx, dy, dz, tNear, nx, ny, nz);
}
<T> {
/ ;
;
;
;
(minX - ox) / dx;
(t < tNear && t > - ) {
oz + dz * t;
oy + dy * t;
(u >= minZ && u <= maxZ && v >= minY && v <= maxY) {
tNear = t;
nx = - ;
}
}
t = (maxX - ox) / dx;
(t < tNear && t > - ) {
oz + dz * t;
oy + dy * t;
(u >= minZ && u <= maxZ && v >= minY && v <= maxY) {
tNear = t;
nx = ;
}
}
t = (minY - oy) / dy;
(t < tNear && t > - ) {
ox + dx * t;
oz + dz * t;
(u >= minX && u <= maxX && v >= minZ && v <= maxZ) {
tNear = t;
ny = - ;
}
}
t = (maxY - oy) / dy;
(t < tNear && t > - ) {
ox + dx * t;
oz + dz * t;
(u >= minX && u <= maxX && v >= minZ && v <= maxZ) {
tNear = t;
ny = ;
}
}
t = (minZ - oz) / dz;
(t < tNear && t > - ) {
ox + dx * t;
oy + dy * t;
(u >= minX && u <= maxX && v >= minY && v <= maxY) {
tNear = t;
nz = - ;
}
}
t = (maxZ - oz) / dz;
(t < tNear && t > - ) {
ox + dx * t;
oy + dy * t;
(u >= minX && u <= maxX && v >= minY && v <= maxY) {
tNear = t;
nz = ;
}
}
consumer.accept(tNear != / , ox, oy, oz, dx, dy, dz, tNear, nx, ny, nz, obj1);
}
<T, K> {
/ ;
;
;
;
(minX - ox) / dx;
(t < tNear && t > - ) {
oz + dz * t;
oy + dy * t;
(u >= minZ && u <= maxZ && v >= minY && v <= maxY) {
tNear = t;
nx = - ;
}
}
t = (maxX - ox) / dx;
(t < tNear && t > - ) {
oz + dz * t;
oy + dy * t;
(u >= minZ && u <= maxZ && v >= minY && v <= maxY) {
tNear = t;
nx = ;
}
}
t = (minY - oy) / dy;
(t < tNear && t > - ) {
ox + dx * t;
oz + dz * t;
(u >= minX && u <= maxX && v >= minZ && v <= maxZ) {
tNear = t;
ny = - ;
}
}
t = (maxY - oy) / dy;
(t < tNear && t > - ) {
ox + dx * t;
oz + dz * t;
(u >= minX && u <= maxX && v >= minZ && v <= maxZ) {
tNear = t;
ny = ;
}
}
t = (minZ - oz) / dz;
(t < tNear && t > - ) {
ox + dx * t;
oy + dy * t;
(u >= minX && u <= maxX && v >= minY && v <= maxY) {
tNear = t;
nz = - ;
}
}
t = (maxZ - oz) / dz;
(t < tNear && t > - ) {
ox + dx * t;
oy + dy * t;
(u >= minX && u <= maxX && v >= minY && v <= maxY) {
tNear = t;
nz = ;
}
}
consumer.accept(tNear != / , ox, oy, oz, dx, dy, dz, tNear, nx, ny, nz, obj1, obj2);
}
<T, K, L> {
/ ;
;
;
;
(minX - ox) / dx;
(t < tNear && t > - ) {
oz + dz * t;
oy + dy * t;
(u >= minZ && u <= maxZ && v >= minY && v <= maxY) {
tNear = t;
nx = - ;
}
}
t = (maxX - ox) / dx;
(t < tNear && t > - ) {
oz + dz * t;
oy + dy * t;
(u >= minZ && u <= maxZ && v >= minY && v <= maxY) {
tNear = t;
nx = ;
}
}
t = (minY - oy) / dy;
(t < tNear && t > - ) {
ox + dx * t;
oz + dz * t;
(u >= minX && u <= maxX && v >= minZ && v <= maxZ) {
tNear = t;
ny = - ;
}
}
t = (maxY - oy) / dy;
(t < tNear && t > - ) {
ox + dx * t;
oz + dz * t;
(u >= minX && u <= maxX && v >= minZ && v <= maxZ) {
tNear = t;
ny = ;
}
}
t = (minZ - oz) / dz;
(t < tNear && t > - ) {
ox + dx * t;
oy + dy * t;
(u >= minX && u <= maxX && v >= minY && v <= maxY) {
tNear = t;
nz = - ;
}
}
t = (maxZ - oz) / dz;
(t < tNear && t > - ) {
ox + dx * t;
oy + dy * t;
(u >= minX && u <= maxX && v >= minY && v <= maxY) {
tNear = t;
nz = ;
}
}
consumer.accept(tNear != / , ox, oy, oz, dx, dy, dz, tNear, nx, ny, nz, obj1, obj2, obj3);
}
{
;
}
<T> {
;
}
<T, K> {
;
}
<T, K, L> {
;
}
}
com/hypixel/hytale/math/shape/Box.java
package com.hypixel.hytale.math.shape;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.function.predicate.TriIntObjPredicate;
import com.hypixel.hytale.function.predicate.TriIntPredicate;
import com.hypixel.hytale.math.Axis;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.math.vector.Vector3d;
import com.hypixel.hytale.math.vector.Vector3i;
import javax.annotation.Nonnull;
public class Box implements Shape {
public static final Codec<Box> CODEC;
public static final Box UNIT;
@Nonnull
public final Vector3d min;
@Nonnull
public final Vector3d max;
@Nonnull
public static Box horizontallyCentered (double width, double height, double depth) {
return new Box (-width / 2.0 , 0.0 , -depth / 2.0 , width / 2.0 , height, depth / 2.0 );
}
{
.min = ();
.max = ();
}
{
();
.min.assign(box.min);
.max.assign(box.max);
}
{
();
.min.assign(min);
.max.assign(max);
}
{
();
.min.assign(xMin, yMin, zMin);
.max.assign(xMax, yMax, zMax);
}
Box {
(min.x, min.y, min.z, min.x + side, min.y + side, min.z + side);
}
Box {
(center.x - inradius, center.y - inradius, center.z - inradius, center.x + inradius, center.y + inradius, center.z + inradius);
}
Box {
.min.assign(min);
.max.assign(max);
;
}
Box {
.min.assign(min);
.max.assign(max);
;
}
Box {
.min.assign(min);
.max.assign(max);
;
}
Box {
.setMinMax( , - );
;
}
Box {
.min.assign(min);
.max.assign(max);
;
}
Box {
( .min.x > bb.min.x) {
.min.x = bb.min.x;
}
( .min.y > bb.min.y) {
.min.y = bb.min.y;
}
( .min.z > bb.min.z) {
.min.z = bb.min.z;
}
( .max.x < bb.max.x) {
.max.x = bb.max.x;
}
( .max.y < bb.max.y) {
.max.y = bb.max.y;
}
( .max.z < bb.max.z) {
.max.z = bb.max.z;
}
;
}
Box {
.min.assign(other.min);
.max.assign(other.max);
;
}
Box {
.min.assign(minX, minY, minZ);
.max.assign(maxX, maxY, maxZ);
;
}
Box {
.min.subtract(bb.max);
.max.subtract(bb.min);
;
}
Box {
.min.scale(( )scale);
.max.scale(( )scale);
;
}
Box {
( .min.x > .max.x) {
.min.x;
.min.x = .max.x;
.max.x = t;
}
( .min.y > .max.y) {
.min.y;
.min.y = .max.y;
.max.y = t;
}
( .min.z > .max.z) {
.min.z;
.min.z = .max.z;
.max.z = t;
}
;
}
Box {
.min.rotateX(angleInRadians);
.max.rotateX(angleInRadians);
;
}
Box {
.min.rotateY(angleInRadians);
.max.rotateY(angleInRadians);
;
}
Box {
.min.rotateZ(angleInRadians);
.max.rotateZ(angleInRadians);
;
}
Box {
.min.add(x, y, z);
.max.add(x, y, z);
;
}
Box {
.min.add(pos);
.max.add(pos);
;
}
Box {
(v.x < ) {
.min;
var10000.x += v.x;
} (v.x > ) {
.max;
var2.x += v.x;
}
(v.y < ) {
.min;
var3.y += v.y;
} (v.y > ) {
.max;
var4.y += v.y;
}
(v.z < ) {
.min;
var5.z += v.z;
} (v.z > ) {
.max;
var6.z += v.z;
}
;
}
Box {
.min.subtract(extentX, extentY, extentZ);
.max.add(extentX, extentY, extentZ);
;
}
{
.max.x - .min.x;
}
{
.max.y - .min.y;
}
{
.max.z - .min.z;
}
{
var10000;
(axis) {
X -> var10000 = .width();
Y -> var10000 = .height();
Z -> var10000 = .depth();
-> ((String) , (Throwable) );
}
var10000;
}
{
MathUtil.minValue( .width(), .height(), .depth());
}
{
MathUtil.maxValue( .width(), .height(), .depth());
}
{
.width();
(w <= ) {
;
} {
.height();
(h <= ) {
;
} {
.depth();
d <= ? : w * h * d;
}
}
}
{
.min.x <= .max.x && .min.y <= .max.y && .min.z <= .max.z;
}
{
!( .min.x > other.max.x) && !(other.min.x > .max.x) && !( .min.y > other.max.y) && !(other.min.y > .max.y) && !( .min.z > other.max.z) && !(other.min.z > .max.z);
}
{
.min.equals(Vector3d.ZERO) && .max.equals(Vector3d.ALL_ONES);
}
{
( .min.x + .max.x) / ;
}
{
( .min.y + .max.y) / ;
}
{
( .min.z + .max.z) / ;
}
Box {
();
box.assign( );
box;
}
Vector3d {
.min;
}
Vector3d {
.max;
}
Box {
( .min.getX() + x, .min.getY() + y, .min.getZ() + z, .max.getX() + x, .max.getY() + y, .max.getZ() + z);
}
{
x >= .min.getX() && x <= .max.getX() && y >= .min.getY() && y <= .max.getY() && z >= .min.getZ() && z <= .max.getZ();
}
{
.extend(radius, radius, radius);
}
{
MathUtil.floor( .min.getX());
MathUtil.floor( .min.getY());
MathUtil.floor( .min.getZ());
MathUtil.ceil( .max.getX());
MathUtil.ceil( .max.getY());
MathUtil.ceil( .max.getZ());
x >= minX && x < maxX && y >= minY && y < maxY && z >= minZ && z < maxZ;
}
{
.containsBlock(x - origin.getX(), y - origin.getY(), z - origin.getZ());
}
{
MathUtil.floor(x + .min.getX() - epsilon);
MathUtil.floor(y + .min.getY() - epsilon);
MathUtil.floor(z + .min.getZ() - epsilon);
MathUtil.floor(x + .max.getX() + epsilon);
MathUtil.floor(y + .max.getY() + epsilon);
MathUtil.floor(z + .max.getZ() + epsilon);
( minX; _x <= maxX; ++_x) {
( minY; _y <= maxY; ++_y) {
( minZ; _z <= maxZ; ++_z) {
(!consumer.test(_x, _y, _z)) {
;
}
}
}
}
;
}
<T> {
MathUtil.floor(x + .min.getX() - epsilon);
MathUtil.floor(y + .min.getY() - epsilon);
MathUtil.floor(z + .min.getZ() - epsilon);
MathUtil.floor(x + .max.getX() + epsilon);
MathUtil.floor(y + .max.getY() + epsilon);
MathUtil.floor(z + .max.getZ() + epsilon);
( minX; _x <= maxX; ++_x) {
( minY; _y <= maxY; ++_y) {
( minZ; _z <= maxZ; ++_z) {
(!consumer.test(_x, _y, _z, t)) {
;
}
}
}
}
;
}
{
;
(- .min.x > maximumExtent) {
maximumExtent = - .min.x;
}
(- .min.y > maximumExtent) {
maximumExtent = - .min.y;
}
(- .min.z > maximumExtent) {
maximumExtent = - .min.z;
}
( .max.x - > maximumExtent) {
maximumExtent = .max.x - ;
}
( .max.y - > maximumExtent) {
maximumExtent = .max.y - ;
}
( .max.z - > maximumExtent) {
maximumExtent = .max.z - ;
}
maximumExtent;
}
{
end.clone().subtract(start);
;
;
(Math.abs(direction.x) < ) {
(start.x < .min.x || start.x > .max.x) {
;
}
} {
( .min.x - start.x) / direction.x;
( .max.x - start.x) / direction.x;
(t1 > t2) {
t1;
t1 = t2;
t2 = temp;
}
tmin = Math.max(tmin, t1);
tmax = Math.min(tmax, t2);
(tmin > tmax) {
;
}
}
(Math.abs(direction.y) < ) {
(start.y < .min.y || start.y > .max.y) {
;
}
} {
( .min.y - start.y) / direction.y;
( .max.y - start.y) / direction.y;
(t1 > t2) {
t1;
t1 = t2;
t2 = temp;
}
tmin = Math.max(tmin, t1);
tmax = Math.min(tmax, t2);
(tmin > tmax) {
;
}
}
(!(Math.abs(direction.z) < )) {
( .min.z - start.z) / direction.z;
( .max.z - start.z) / direction.z;
(t1 > t2) {
t1;
t1 = t2;
t2 = temp;
}
tmin = Math.max(tmin, t1);
tmax = Math.min(tmax, t2);
!(tmin > tmax);
} {
!(start.z < .min.z) && !(start.z > .max.z);
}
}
String {
String.valueOf( .min);
+ var10000 + + String.valueOf( .max) + ;
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(Box.class, Box:: ).append( ( , Vector3d.CODEC), (box, v) -> box.min.assign(v), (box) -> box.min).add()).append( ( , Vector3d.CODEC), (box, v) -> box.max.assign(v), (box) -> box.max).add()).validator((box, results) -> {
(box.width() <= ) {
results.fail( + box.width());
}
(box.height() <= ) {
results.fail( + box.height());
}
(box.depth() <= ) {
results.fail( + box.depth());
}
})).build();
UNIT = (Vector3d.ZERO, Vector3d.ALL_ONES);
}
}
com/hypixel/hytale/math/shape/Box2D.java
package com.hypixel.hytale.math.shape;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.math.vector.Vector2d;
import javax.annotation.Nonnull;
public class Box2D implements Shape2D {
public static final BuilderCodec<Box2D> CODEC;
@Nonnull
public final Vector2d min;
@Nonnull
public final Vector2d max;
public Box2D () {
this .min = new Vector2d ();
this .max = new Vector2d ();
}
public Box2D (@Nonnull Box2D box) {
this ();
this .min.assign(box.min);
this .max.assign(box.max);
}
public Box2D (@Nonnull Vector2d min, @Nonnull Vector2d max) {
this ();
this .min.assign(min);
this .max.assign(max);
}
public Box2D ( xMin, yMin, xMax, yMax) {
();
.min.assign(xMin, yMin);
.max.assign(xMax, yMax);
}
Box2D {
.min.assign(min);
.max.assign(max);
;
}
Box2D {
.min.assign(min);
.max.assign(max);
;
}
Box2D {
.min.assign(min);
.max.assign(max);
;
}
Box2D {
.setMinMax( , - );
;
}
Box2D {
.min.assign(min);
.max.assign(max);
;
}
Box2D {
( .min.x > bb.min.x) {
.min.x = bb.min.x;
}
( .min.y > bb.min.y) {
.min.y = bb.min.y;
}
( .max.x < bb.max.x) {
.max.x = bb.max.x;
}
( .max.y < bb.max.y) {
.max.y = bb.max.y;
}
;
}
Box2D {
.min.assign(other.min);
.max.assign(other.max);
;
}
Box2D {
.min.subtract(bb.max);
.max.subtract(bb.min);
;
}
Box2D {
( .min.x > .max.x) {
.min.x;
.min.x = .max.x;
.max.x = t;
}
( .min.y > .max.y) {
.min.y;
.min.y = .max.y;
.max.y = t;
}
;
}
Box2D {
.min.add(pos);
.max.add(pos);
;
}
Box2D {
(v.x < ) {
.min;
var10000.x += v.x;
} (v.x > ) {
.max;
var2.x += v.x;
}
(v.y < ) {
.min;
var3.y += v.y;
} (v.y > ) {
.max;
var4.y += v.y;
}
;
}
Box2D {
.min.floor();
.max.ceil();
;
}
Box2D {
.min.subtract(extentX, extentY);
.max.add(extentX, extentY);
;
}
{
.max.x - .min.x;
}
{
.max.y - .min.y;
}
{
!( .min.x > other.max.x) && !(other.min.x > .max.x) && !( .min.y > other.max.y) && !(other.min.y > .max.y);
}
Box2D {
( .min.getX() + x, .min.getY() + y, .max.getX() + x, .max.getY() + y);
}
{
position.getX() - origin.getX();
position.getY() - origin.getY();
x >= .min.getX() && x <= .max.getX() && y >= .min.getY() && y <= .max.getY();
}
{
xx - origin.getX();
yy - origin.getY();
x >= .min.getX() && x <= .max.getX() && y >= .min.getY() && y <= .max.getY();
}
String {
String.valueOf( .min);
+ var10000 + + String.valueOf( .max) + ;
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(Box2D.class, Box2D:: ).append( ( , Vector2d.CODEC), (shape, min) -> shape.min.assign(min), (shape) -> shape.min).add()).append( ( , Vector2d.CODEC), (shape, max) -> shape.max.assign(max), (shape) -> shape.max).add()).build();
}
}
com/hypixel/hytale/math/shape/Cylinder.java
package com.hypixel.hytale.math.shape;
import com.hypixel.hytale.function.predicate.TriIntObjPredicate;
import com.hypixel.hytale.function.predicate.TriIntPredicate;
import com.hypixel.hytale.math.block.BlockCylinderUtil;
import com.hypixel.hytale.math.util.MathUtil;
import javax.annotation.Nonnull;
public class Cylinder implements Shape {
public double height;
public double radiusX;
public double radiusZ;
public Cylinder () {
}
public Cylinder (double height, double radiusX, double radiusZ) {
this .height = height;
this .radiusX = radiusX;
this .radiusZ = radiusZ;
}
public double getRadiusX () {
return this .radiusX;
}
public double getRadiusZ () {
return this .radiusZ;
}
public double getHeight () {
return .height;
}
Cylinder {
.radiusX = radius;
.radiusZ = radius;
;
}
{
(!(y > .height) && !(y < )) {
x * x / ( .radiusX * .radiusX) + z * z / ( .radiusZ * .radiusZ);
result <= ;
} {
;
}
}
{
BlockCylinderUtil.forEachBlock(MathUtil.floor(x), MathUtil.floor(y), MathUtil.floor(z), MathUtil.floor( .radiusX + epsilon), MathUtil.floor( .height + epsilon), MathUtil.floor( .radiusZ + epsilon), (Object) , (_x, _y, _z, aVoid) -> consumer.test(_x, _y, _z));
}
<T> {
BlockCylinderUtil.forEachBlock(MathUtil.floor(x), MathUtil.floor(y), MathUtil.floor(z), MathUtil.floor( .radiusX + epsilon), MathUtil.floor( .height + epsilon), MathUtil.floor( .radiusZ + epsilon), t, consumer);
}
{
.radiusX += radius;
.radiusZ += radius;
}
Box {
Math.max( .radiusX, .radiusZ);
();
boundingBox.min.assign(x - biggestRadius, y, z - biggestRadius);
boundingBox.max.assign(x + biggestRadius, y + .height, z + biggestRadius);
boundingBox;
}
Cylinder {
( .height, .radiusX, .radiusZ);
}
String {
+ .height + + .radiusX + + .radiusZ + ;
}
}
com/hypixel/hytale/math/shape/Ellipsoid.java
package com.hypixel.hytale.math.shape;
import com.hypixel.hytale.function.predicate.TriIntObjPredicate;
import com.hypixel.hytale.function.predicate.TriIntPredicate;
import com.hypixel.hytale.math.block.BlockSphereUtil;
import com.hypixel.hytale.math.util.MathUtil;
import javax.annotation.Nonnull;
public class Ellipsoid implements Shape {
public double radiusX;
public double radiusY;
public double radiusZ;
public Ellipsoid () {
}
public Ellipsoid (double radius) {
this (radius, radius, radius);
}
public Ellipsoid (double radiusX, double radiusY, double radiusZ) {
this .radiusX = radiusX;
this .radiusY = radiusY;
this .radiusZ = radiusZ;
}
@Nonnull
public Ellipsoid assign (double radius) {
this .radiusX = radius;
this .radiusY = radius;
this .radiusZ = radius;
return this ;
}
Box {
();
boundingBox.min.assign(x - .radiusX, y - .radiusY, z - .radiusZ);
boundingBox.max.assign(x + .radiusX, y + .radiusY, z + .radiusZ);
boundingBox;
}
{
x / .radiusX;
y / .radiusY;
z / .radiusZ;
xRatio * xRatio + yRatio * yRatio + zRatio * zRatio <= ;
}
{
.radiusX += radius;
.radiusY += radius;
.radiusZ += radius;
}
{
BlockSphereUtil.forEachBlock(MathUtil.floor(x), MathUtil.floor(y), MathUtil.floor(z), MathUtil.floor( .radiusX + epsilon), MathUtil.floor( .radiusY + epsilon), MathUtil.floor( .radiusZ + epsilon), (Object) , (_x, _y, _z, aVoid) -> consumer.test(_x, _y, _z));
}
<T> {
BlockSphereUtil.forEachBlock(MathUtil.floor(x), MathUtil.floor(y), MathUtil.floor(z), MathUtil.floor( .radiusX + epsilon), MathUtil.floor( .radiusY + epsilon), MathUtil.floor( .radiusZ + epsilon), t, consumer);
}
String {
+ .radiusX + + .radiusY + + .radiusZ + ;
}
}
com/hypixel/hytale/math/shape/OriginShape.java
package com.hypixel.hytale.math.shape;
import com.hypixel.hytale.function.predicate.TriIntObjPredicate;
import com.hypixel.hytale.function.predicate.TriIntPredicate;
import com.hypixel.hytale.math.vector.Vector3d;
import javax.annotation.Nonnull;
public class OriginShape <S extends Shape > implements Shape {
public final Vector3d origin;
public S shape;
public OriginShape () {
this .origin = new Vector3d ();
}
public OriginShape (Vector3d origin, S shape) {
this .origin = origin;
this .shape = shape;
}
public Vector3d getOrigin () {
return this .origin;
}
public S getShape () {
return this .shape;
}
public Box getBox (double x, double y, double z) {
return this .shape.getBox(x + this .origin.getX(), y + this .origin.getY(), z + .origin.getZ());
}
{
.shape.containsPosition(x - .origin.getX(), y - .origin.getY(), z - .origin.getZ());
}
{
.shape.expand(radius);
}
{
.shape.forEachBlock(x + .origin.getX(), y + .origin.getY(), z + .origin.getZ(), epsilon, consumer);
}
<T> {
.shape.forEachBlock(x + .origin.getX(), y + .origin.getY(), z + .origin.getZ(), epsilon, t, consumer);
}
String {
String.valueOf( .origin);
+ var10000 + + String.valueOf( .shape) + ;
}
}
com/hypixel/hytale/math/shape/Quad2d.java
package com.hypixel.hytale.math.shape;
import com.hypixel.hytale.math.vector.Vector2d;
import java.util.Random;
import javax.annotation.Nonnull;
public class Quad2d {
private Vector2d a;
private Vector2d b;
private Vector2d c;
private Vector2d d;
public Quad2d (Vector2d a, Vector2d b, Vector2d c, Vector2d d) {
this .a = a;
this .b = b;
this .c = c;
this .d = d;
}
public Quad2d () {
this (new Vector2d (), new Vector2d (), new Vector2d (), new Vector2d ());
}
public Quad2d (@Nonnull Vector2d[] points) {
this (points, 0 , 1 , 2 , 3 );
}
public Quad2d (@Nonnull Vector2d[] points, int a, int b, int c, int d) {
this (points[a], points[b], points[c], points[d]);
}
Vector2d {
.a;
}
Vector2d {
.b;
}
Vector2d {
.c;
}
Vector2d {
.d;
}
{
.a.x;
(min > .b.x) {
min = .b.x;
}
(min > .c.x) {
min = .c.x;
}
(min > .d.x) {
min = .d.x;
}
min;
}
{
.a.y;
(min > .b.y) {
min = .b.y;
}
(min > .c.y) {
min = .c.y;
}
(min > .d.y) {
min = .d.y;
}
min;
}
{
.a.x;
(max < .b.x) {
max = .b.x;
}
(max < .c.x) {
max = .c.x;
}
(max < .d.x) {
max = .d.x;
}
max;
}
{
.a.y;
(max < .b.y) {
max = .b.y;
}
(max < .c.y) {
max = .c.y;
}
(max < .d.y) {
max = .d.y;
}
max;
}
Vector2d {
.getCenter( ());
}
Vector2d {
target.assign(( .a.x + .c.x) * , ( .a.y + .c.y) * );
}
Vector2d {
.getRandom(random, ());
}
Vector2d {
random.nextDouble();
random.nextDouble();
(p + q > ) {
p = - p;
q = - q;
}
- p - q;
(random.nextBoolean()) {
vec.assign(- .a.x * pq + .b.x * p + .c.x * q, - .a.y * pq + .b.y * p + .c.y * q);
} {
vec.assign(- .a.x * pq + .c.x * p + .d.x * q, - .a.y * pq + .c.y * p + .d.y * q);
}
vec;
}
String {
String.valueOf( .a);
+ var10000 + + String.valueOf( .b) + + String.valueOf( .c) + ;
}
}
com/hypixel/hytale/math/shape/Quad4d.java
package com.hypixel.hytale.math.shape;
import com.hypixel.hytale.math.matrix.Matrix4d;
import com.hypixel.hytale.math.vector.Vector4d;
import java.util.Random;
import javax.annotation.Nonnull;
public class Quad4d {
private Vector4d a;
private Vector4d b;
private Vector4d c;
private Vector4d d;
public Quad4d (Vector4d a, Vector4d b, Vector4d c, Vector4d d) {
this .a = a;
this .b = b;
this .c = c;
this .d = d;
}
public Quad4d () {
this (new Vector4d (), new Vector4d (), new Vector4d (), new Vector4d ());
}
public Quad4d (@Nonnull Vector4d[] points) {
this (points, 0 , 1 , 2 , 3 );
}
public Quad4d (@Nonnull Vector4d[] points, int a, int b, int c, d) {
(points[a], points[b], points[c], points[d]);
}
{
.a.isInsideFrustum() && .b.isInsideFrustum() && .c.isInsideFrustum() && .d.isInsideFrustum();
}
Vector4d {
.a;
}
Vector4d {
.b;
}
Vector4d {
.c;
}
Vector4d {
.d;
}
Vector4d {
Vector4d var10000;
(idx) {
-> var10000 = .a;
-> var10000 = .b;
-> var10000 = .c;
-> var10000 = .d;
-> ( + idx);
}
var10000;
}
{
.a.get(component);
(min > .b.get(component)) {
min = .b.get(component);
}
(min > .c.get(component)) {
min = .c.get(component);
}
(min > .d.get(component)) {
min = .d.get(component);
}
min;
}
{
.a.get(component);
(max < .b.get(component)) {
max = .b.get(component);
}
(max < .c.get(component)) {
max = .c.get(component);
}
(max < .d.get(component)) {
max = .d.get(component);
}
max;
}
Quad4d {
.multiply(matrix, );
}
Quad4d {
matrix.multiply( .a, target.a);
matrix.multiply( .b, target.b);
matrix.multiply( .c, target.c);
matrix.multiply( .d, target.d);
target;
}
Quad2d {
target.getA().assign( .a.x, .a.y);
target.getB().assign( .b.x, .b.y);
target.getC().assign( .c.x, .c.y);
target.getD().assign( .d.x, .d.y);
target;
}
Vector4d {
.getCenter( ());
}
Vector4d {
target.assign( .a.x + ( .c.x - .a.x) * , .b.x + ( .b.x - .b.x) * , .c.x + ( .c.x - .c.x) * , .d.x + ( .d.x - .d.x) * );
}
{
.a.perspectiveTransform();
.b.perspectiveTransform();
.c.perspectiveTransform();
.d.perspectiveTransform();
}
Vector4d {
.getRandom(random, ());
}
Vector4d {
random.nextDouble();
random.nextDouble() * ( - p);
- p - q;
(random.nextBoolean()) {
target.assign( .a.x * pq + .b.x * p + .c.x * q, .a.y * pq + .b.y * p + .c.y * q, .a.z * pq + .b.z * p + .c.z * q, .a.w * pq + .b.w * p + .c.w * q);
} {
target.assign( .a.x * pq + .c.x * p + .d.x * q, .a.y * pq + .c.y * p + .d.y * q, .a.z * pq + .c.z * p + .d.z * q, .a.w * pq + .c.w * p + .d.w * q);
}
target;
}
String {
String.valueOf( .a);
+ var10000 + + String.valueOf( .b) + + String.valueOf( .c) + + String.valueOf( .d) + ;
}
}
com/hypixel/hytale/math/shape/Rectangle.java
package com.hypixel.hytale.math.shape;
import com.hypixel.hytale.math.vector.Vector2d;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class Rectangle {
private Vector2d min;
private Vector2d max;
public Rectangle () {
this (new Vector2d (), new Vector2d ());
}
public Rectangle (double minX, double minY, double maxX, double maxY) {
this (new Vector2d (minX, minY), new Vector2d (maxX, maxY));
}
public Rectangle (Vector2d min, Vector2d max) {
this .min = min;
this .max = max;
}
public Rectangle (@Nonnull Rectangle other) {
this (other.getMinX(), other.getMinY(), other.getMaxX(), other.getMaxY());
}
public Vector2d getMin () {
return this .min;
}
public Vector2d getMax {
.max;
}
{
.min.x;
}
{
.min.y;
}
{
.max.x;
}
{
.max.y;
}
Rectangle {
.min.x = minX;
.min.y = minY;
.max.x = maxX;
.max.y = maxY;
;
}
{
.min.x < .max.x && .min.y < .max.y;
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(Rectangle)o;
( .min != ) {
(! .min.equals(that.min)) {
;
}
} (that.min != ) {
;
}
.max != ? .max.equals(that.max) : that.max == ;
} {
;
}
}
{
.min != ? .min.hashCode() : ;
result = * result + ( .max != ? .max.hashCode() : );
result;
}
String {
String.valueOf( .min);
+ var10000 + + String.valueOf( .max) + ;
}
}
com/hypixel/hytale/math/shape/Shape.java
package com.hypixel.hytale.math.shape;
import com.hypixel.hytale.function.predicate.TriIntObjPredicate;
import com.hypixel.hytale.function.predicate.TriIntPredicate;
import com.hypixel.hytale.math.vector.Vector3d;
import javax.annotation.Nonnull;
public interface Shape {
default Box getBox (@Nonnull Vector3d position) {
return this .getBox(position.getX(), position.getY(), position.getZ());
}
Box getBox (double var1, double var3, double var5) ;
default boolean containsPosition (@Nonnull Vector3d origin, @Nonnull Vector3d position) {
return this .containsPosition(position.getX() - origin.getX(), position.getY() - origin.getY(), position.getZ() - origin.getZ());
}
default boolean containsPosition (@Nonnull Vector3d position) {
return this .containsPosition(position.getX(), position.getY(), position.getZ());
}
boolean containsPosition (double var1, double var3, double var5) ;
void expand (double var1) ;
{
.forEachBlock(origin.getX(), origin.getY(), origin.getZ(), consumer);
}
{
.forEachBlock(origin.getX(), origin.getY(), origin.getZ(), epsilon, consumer);
}
{
.forEachBlock(x, y, z, , consumer);
}
;
<T> {
.forEachBlock(origin.getX(), origin.getY(), origin.getZ(), t, consumer);
}
<T> {
.forEachBlock(origin.getX(), origin.getY(), origin.getZ(), epsilon, t, consumer);
}
<T> {
.forEachBlock(x, y, z, , t, consumer);
}
<T> ;
}
com/hypixel/hytale/math/shape/Shape2D.java
package com.hypixel.hytale.math.shape;
import com.hypixel.hytale.math.vector.Vector2d;
import javax.annotation.Nonnull;
public interface Shape2D {
default Box2D getBox (@Nonnull Vector2d position) {
return this .getBox(position.getX(), position.getY());
}
Box2D getBox (double var1, double var3) ;
boolean containsPosition (Vector2d var1, Vector2d var2) ;
boolean containsPosition (Vector2d var1, double var2, double var4) ;
}
com/hypixel/hytale/math/shape/Triangle2d.java
package com.hypixel.hytale.math.shape;
import com.hypixel.hytale.math.vector.Vector2d;
import java.util.Random;
import javax.annotation.Nonnull;
public class Triangle2d {
private Vector2d a;
private Vector2d b;
private Vector2d c;
public Triangle2d (Vector2d a, Vector2d b, Vector2d c) {
this .a = a;
this .b = b;
this .c = c;
}
public Triangle2d () {
this (new Vector2d (), new Vector2d (), new Vector2d ());
}
public Triangle2d (@Nonnull Vector2d[] points) {
this (points, 0 , 1 , 2 );
}
public Triangle2d (@Nonnull Vector2d[] points, int a, int b, int c) {
this (points[a], points[b], points[c]);
}
public Vector2d getA () {
return this .a;
}
{
.a = a;
}
Vector2d {
.b;
}
{
.b = b;
}
Vector2d {
.c;
}
{
.c = c;
}
{
.a.x;
(min > .b.x) {
min = .b.x;
}
(min > .c.x) {
min = .c.x;
}
min;
}
{
.a.y;
(min > .b.y) {
min = .b.y;
}
(min > .c.y) {
min = .c.y;
}
min;
}
{
.a.x;
(max < .b.x) {
max = .b.x;
}
(max < .c.x) {
max = .c.x;
}
max;
}
{
.a.y;
(max < .b.y) {
max = .b.y;
}
(max < .c.y) {
max = .c.y;
}
max;
}
Vector2d {
.getRandom(random, ());
}
Vector2d {
random.nextDouble();
random.nextDouble();
(p + q > ) {
p = - p;
q = - q;
}
vec.assign(- .a.x * ( - p - q) + .b.x * p + .c.x * q, - .a.y * ( - p - q) + .b.y * p + .c.y * q);
vec;
}
}
com/hypixel/hytale/math/shape/Triangle4d.java
package com.hypixel.hytale.math.shape;
import com.hypixel.hytale.math.matrix.Matrix4d;
import com.hypixel.hytale.math.vector.Vector4d;
import java.util.Random;
import javax.annotation.Nonnull;
public class Triangle4d {
private Vector4d a;
private Vector4d b;
private Vector4d c;
public Triangle4d (Vector4d a, Vector4d b, Vector4d c) {
this .a = a;
this .b = b;
this .c = c;
}
public Triangle4d () {
this (new Vector4d (), new Vector4d (), new Vector4d ());
}
public Triangle4d (@Nonnull Vector4d[] points) {
this (points, 0 , 1 , 2 );
}
public Triangle4d (@Nonnull Vector4d[] points, int a, int b, int c) {
this (points[a], points[b], points[c]);
}
public Vector4d getA () {
return .a;
}
Vector4d {
.b;
}
Vector4d {
.c;
}
{
.a.get(component);
(min > .b.get(component)) {
min = .b.get(component);
}
(min > .c.get(component)) {
min = .c.get(component);
}
min;
}
{
.a.get(component);
(max < .b.get(component)) {
max = .b.get(component);
}
(max < .c.get(component)) {
max = .c.get(component);
}
max;
}
Triangle4d {
.a.assign(v1);
.b.assign(v2);
.c.assign(v3);
;
}
Vector4d {
.getRandom(random, ());
}
Vector4d {
random.nextDouble();
random.nextDouble() * ( - p);
- p - q;
vec.assign( .a.x * pq + .b.x * p + .c.x * q, .a.y * pq + .b.y * p + .c.y * q, .a.z * pq + .b.z * p + .c.z * q, .a.w * pq + .b.w * p + .c.w * q);
vec;
}
Triangle4d {
.multiply(matrix, );
}
Triangle4d {
matrix.multiply( .a, target.a);
matrix.multiply( .b, target.b);
matrix.multiply( .c, target.c);
target;
}
Triangle2d {
target.getA().assign( .a.x, .a.y);
target.getB().assign( .b.x, .b.y);
target.getC().assign( .c.x, .c.y);
target;
}
Triangle4d {
.a.perspectiveTransform();
.b.perspectiveTransform();
.c.perspectiveTransform();
;
}
String {
String.valueOf( .a);
+ var10000 + + String.valueOf( .b) + + String.valueOf( .c) + ;
}
}
com/hypixel/hytale/math/shape/ViewUtil.java
package com.hypixel.hytale.math.shape;
import com.hypixel.hytale.math.vector.Vector2d;
import java.awt.Graphics2D;
public class ViewUtil {
public static final int INSIDE = 0 ;
public static final int LEFT = 1 ;
public static final int RIGHT = 2 ;
public static final int BOTTOM = 4 ;
public static final int TOP = 8 ;
private ViewUtil () {
throw new UnsupportedOperationException ();
}
private static int computeOutCode (double x, y) {
;
(x < - ) {
code |= ;
} (x > ) {
code |= ;
}
(y < - ) {
code |= ;
} (y > ) {
code |= ;
}
code;
}
{
computeOutCode(x0, y0);
computeOutCode(x1, y1);
;
( ) {
((outcode0 | outcode1) == ) {
accept = ;
;
}
((outcode0 & outcode1) != ) {
;
}
outcode0 != ? outcode0 : outcode1;
x;
y;
((outcodeOut & ) != ) {
x = x0 + (x1 - x0) * ( - y0) / (y1 - y0);
y = ;
} ((outcodeOut & ) != ) {
x = x0 + (x1 - x0) * (- - y0) / (y1 - y0);
y = - ;
} ((outcodeOut & ) != ) {
y = y0 + (y1 - y0) * ( - x0) / (x1 - x0);
x = ;
} ((outcodeOut & ) != ) {
y = y0 + (y1 - y0) * (- - x0) / (x1 - x0);
x = - ;
} {
x = ;
y = ;
}
(outcodeOut == outcode0) {
x0 = x;
y0 = y;
outcode0 = computeOutCode(x, y);
} {
x1 = x;
y1 = y;
outcode1 = computeOutCode(x, y);
}
}
(accept) {
(x0, y0);
(x1, y1);
}
}
}
com/hypixel/hytale/math/util/ChunkUtil.java
package com.hypixel.hytale.math.util;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import javax.annotation.Nonnull;
public class ChunkUtil {
public static final int BITS = 5 ;
public static final int SIZE = 32 ;
public static final int SIZE_2 = 1024 ;
public static final int SIZE_MINUS_1 = 31 ;
public static final int SIZE_MASK = 31 ;
public static final int SIZE_COLUMNS = 1024 ;
public static final int SIZE_COLUMNS_MASK ;
;
;
- ;
;
;
;
(Integer.highestOneBit( ) << ) - ;
;
indexChunk(- , - );
;
- ;
;
{
}
[] shortToByteArray( [] data) {
ByteBuffer.allocate(data.length * ).order(ByteOrder.LITTLE_ENDIAN);
byteBuffer.asShortBuffer().put(data);
byteBuffer.array();
}
[] intToByteArray( [] data) {
ByteBuffer.allocate(data.length * ).order(ByteOrder.LITTLE_ENDIAN);
byteBuffer.asIntBuffer().put(data);
byteBuffer.array();
}
{
(z & ) << | x & ;
}
{
index & ;
}
{
index >> & ;
}
{
y >> ;
}
{
(y & ) << | column & ;
}
{
(y & ) << | (z & ) << | x & ;
}
{
index & ;
}
{
index >> & ;
}
{
index >> & ;
}
{
(y & HEIGHT_MASK) << | (z & ) << | x & ;
}
{
(y & HEIGHT_MASK) << | column & ;
}
{
index & ;
}
{
index >> & HEIGHT_MASK;
}
{
index >> & ;
}
{
( )(v & );
}
{
MathUtil.floor(block) >> ;
}
{
block >> ;
}
{
( )(block >> );
}
{
index << ;
}
{
(index << ) + ;
}
{
x >= && z >= && x < && z < ;
}
{
x == || z == || x == || z == ;
}
{
x &= ;
z &= ;
isBorderBlock(x, z);
}
{
chunkCoordinate(x) == chunkX && chunkCoordinate(z) == chunkZ;
}
{
chunkCoordinate(x0) == chunkCoordinate(x1) && chunkCoordinate(z0) == chunkCoordinate(z1);
}
{
chunkCoordinate(x0) == chunkCoordinate(x1) && chunkCoordinate(y0) == chunkCoordinate(y1) && chunkCoordinate(z0) == chunkCoordinate(z1);
}
{
(x & ) == x && (z & ) == z;
}
{
( )(index >> );
}
{
( )index;
}
{
( )x << | ( )z & ;
}
{
indexChunk(chunkCoordinate(blockX), chunkCoordinate(blockZ));
}
{
indexChunkFromBlock(MathUtil.floor(blockX), MathUtil.floor(blockZ));
}
{
chunkCoord << | localCoord;
}
}
com/hypixel/hytale/math/util/FastRandom.java
package com.hypixel.hytale.math.util;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
public class FastRandom extends Random {
private static final long multiplier = 25214903917L ;
private static final long addend = 11L ;
private static final long mask = 281474976710655L ;
private long seed;
public FastRandom () {
this .seed = initialScramble(ThreadLocalRandom.current().nextLong());
}
public FastRandom (long seed) {
this .seed = initialScramble(seed);
}
public void setSeed (long seed) {
this .seed = initialScramble(seed);
}
private static long initialScramble {
(seed ^ ) & ;
}
{
.seed;
seed = seed * + & ;
.seed = seed;
( )(seed >>> - bits);
}
{
();
}
}
com/hypixel/hytale/math/util/HashUtil.java
package com.hypixel.hytale.math.util;
import java.util.UUID;
import javax.annotation.Nonnull;
public class HashUtil {
public static long hash (long v) {
v = (v >>> 30 ^ v) * -4658895280553007687L ;
v = (v >>> 27 ^ v) * -7723592293110705685L ;
v = v >>> 31 ^ v;
return v;
}
public static long hash (long l1, long l2) {
l1 = (hash(l1) >>> 30 ^ l1) * -4658895280553007687L ;
l1 = hash(l2) >>> 31 ^ l1;
return l1;
}
public static long hash (long l1, long l2, long l3) {
l1 = (hash(l1) >>> 30 ^ l1) * -4658895280553007687L ;
l1 = (hash(l2) >>> 27 ^ l1) * -7723592293110705685L ;
l1 = hash(l3) >>> 31 ^ l1;
return l1;
}
public static long hash ( l1, l2, l3, l4) {
l1 = (hash(l1) >>> ^ l1) * - ;
l1 = (hash(l2) >>> ^ l1) * - ;
l1 = (hash(l3) >>> ^ l1) * - ;
l1 = hash(l4) >>> ^ l1;
l1;
}
{
hash(hash(l1));
}
{
hash(hash(l1, l2));
}
{
hash(hash(l1, l2, l3));
}
{
hash(hash(l1, l2, l3, l4));
}
{
hashToRandomDouble(rehash(l1));
}
{
hashToRandomDouble(rehash(l1, l2));
}
{
hashToRandomDouble(rehash(l1, l2, l3));
}
{
hashToRandomDouble(rehash(l1, l2, l3, l4));
}
{
rehash(l1, l2, l3);
hash &= ;
( )(hash % ( )bound);
}
{
hash &= ;
( )hash / ;
}
{
hash(uuid.getLeastSignificantBits(), uuid.getMostSignificantBits());
}
{
}
}
com/hypixel/hytale/math/util/MathUtil.java
package com.hypixel.hytale.math.util;
import com.hypixel.hytale.math.vector.Vector3d;
import com.hypixel.hytale.math.vector.Vector3f;
import com.hypixel.hytale.math.vector.Vector3i;
import java.util.concurrent.ThreadLocalRandom;
import javax.annotation.Nonnull;
public class MathUtil {
public static final double EPSILON_DOUBLE = Math.ulp(1.0 );
public static final float EPSILON_FLOAT = Math.ulp(1.0F );
public static float PITCH_EDGE_PADDING = 0.01F ;
public static int abs (int i) {
int mask = i >> 31 ;
return i + mask ^ mask;
}
public static int floor (double d) {
int i = (int )d;
(( )i <= d) {
i;
} {
d < - ? - : i - ;
}
}
{
( )d;
(d > && d != ( )i) {
d > ? : i + ;
} {
i;
}
}
{
ThreadLocalRandom.current().nextInt(min, max);
}
{
min + Math.random() * (max - min);
}
{
min + ( )Math.random() * (max - min);
}
{
Math.pow( , ( )p);
( )Math.round(d * pow) / pow;
}
{
val >= min && val <= max;
}
{
(a < v) {
v = a;
}
(c < v) {
v = c;
}
v;
}
{
(a < v) {
v = a;
}
(c < v) {
v = c;
}
v;
}
{
(a > v) {
v = a;
}
(b > v) {
v = b;
}
(c > v) {
v = c;
}
v;
}
{
(a > v) {
v = a;
}
(b > v) {
v = b;
}
v;
}
{
(a > v) {
v = a;
}
(b > v) {
v = b;
}
v;
}
{
(a > v) {
v = a;
}
(b > v) {
v = b;
}
(c > v) {
v = c;
}
v;
}
{
(a > v) {
v = a;
}
(b > v) {
v = b;
}
v;
}
{
x * x + y * y;
}
{
Math.sqrt(lengthSquared(x, y));
}
{
x * x + y * y + z * z;
}
{
Math.sqrt(lengthSquared(x, y, z));
}
{
a > v ? a : v;
}
{
clipToZero(v, EPSILON_DOUBLE);
}
{
v >= -epsilon && v <= epsilon ? : v;
}
{
clipToZero(v, EPSILON_FLOAT);
}
{
v >= -epsilon && v <= epsilon ? : v;
}
{
closeToZero(v, EPSILON_DOUBLE);
}
{
v >= -epsilon && v <= epsilon;
}
{
closeToZero(v, EPSILON_FLOAT);
}
{
v >= -epsilon && v <= epsilon;
}
{
(v > max) {
v < min ? min : max;
} {
v < min ? min : v;
}
}
{
(v > max) {
v < min ? min : max;
} {
v < min ? min : v;
}
}
{
(v > max) {
v < min ? min : max;
} {
v < min ? min : v;
}
}
{
(v > max) {
v < min ? min : max;
} {
v < min ? min : v;
}
}
{
( )(( )index / (( )max - ) * );
}
{
total == ? : ( )v * / ( )total;
}
{
fastFloor(f + );
}
{
fastFloor(d + );
}
{
( )f;
(( )i <= f) {
i;
} {
f < - ? - : i - ;
}
}
{
( )d;
(( )i <= d) {
i;
} {
d < - ? - : i - ;
}
}
{
( )f;
(f > && f != ( )i) {
f > ? : i + ;
} {
i;
}
}
{
( )d;
(d > && d != ( )i) {
d > ? : i + ;
} {
i;
}
}
{
}
{
hbits & ;
hbits & ;
(exp == ) {
exp = ;
} (exp != ) {
exp += ;
(mant == && exp > ) {
Float.intBitsToFloat((hbits & ) << | exp << | );
}
} (mant != ) {
exp = ;
{
mant <<= ;
exp -= ;
} ((mant & ) == );
mant &= ;
}
Float.intBitsToFloat((hbits & ) << | (exp | mant) << );
}
{
Float.floatToIntBits(fval);
fbits >>> & ;
(fbits & ) + ;
(val >= ) {
((fbits & ) >= ) {
val < ? sign | : sign | | (fbits & ) >>> ;
} {
sign | ;
}
} (val >= ) {
sign | val - >>> ;
} (val < ) {
sign;
} {
val = (fbits & ) >>> ;
sign | (fbits & | ) + ( >>> val - ) >>> - val;
}
}
{
(i > ) {
;
} (i > ) {
;
} {
i > ? : ;
}
}
{
x << | z & ;
}
{
packed >> & ;
((i & ) != ) {
i |= - ;
}
i;
}
{
packed & ;
((i & ) != ) {
i |= - ;
}
i;
}
{
( )left << | ( )right & ;
}
{
( )(packed >> );
}
{
( )packed;
}
Vector3i {
* ( )angle;
x1;
z1;
(clockwise) {
x1 = ( )(( )vector.x * TrigMathUtil.cos(radAngle) - ( )vector.z * TrigMathUtil.sin(radAngle));
z1 = ( )(( )vector.x * TrigMathUtil.sin(radAngle) + ( )vector.z * TrigMathUtil.cos(radAngle));
} {
x1 = ( )(( )vector.x * TrigMathUtil.cos(radAngle) + ( )vector.z * TrigMathUtil.sin(radAngle));
z1 = ( )(( )(-vector.x) * TrigMathUtil.sin(radAngle) + ( )vector.z * TrigMathUtil.cos(radAngle));
}
(x1, vector.y, z1);
}
Vector3d {
* ( )angle;
x1;
z1;
(clockwise) {
x1 = vector.x * ( )TrigMathUtil.cos(radAngle) - vector.z * ( )TrigMathUtil.sin(radAngle);
z1 = vector.x * ( )TrigMathUtil.sin(radAngle) + vector.z * ( )TrigMathUtil.cos(radAngle);
} {
x1 = vector.x * ( )TrigMathUtil.cos(radAngle) + vector.z * ( )TrigMathUtil.sin(radAngle);
z1 = -vector.x * ( )TrigMathUtil.sin(radAngle) + vector.z * ( )TrigMathUtil.cos(radAngle);
}
(x1, vector.y, z1);
}
{
angle %= ;
(angle <= - ) {
angle += ;
} (angle > ) {
angle -= ;
}
angle;
}
{
lerpUnclamped(a, b, clamp(t, , ));
}
{
a + t * (b - a);
}
{
lerpUnclamped(a, b, clamp(t, , ));
}
{
a + t * (b - a);
}
{
(b - a) % ;
* distance % - distance;
}
{
a + shortAngleDistance(a, b) * t;
}
{
x - Math.floor(x / y) * y;
}
{
b - a;
floorMod(diff + , ) - ;
}
{
(sortedData.length == ) {
( )sortedData[ ];
} (percentile >= ) {
( )sortedData[sortedData.length - ];
} {
( )(sortedData.length + ) * percentile;
percentile * ( )(sortedData.length - ) + ;
left;
right;
(position >= ) {
left = sortedData[floor(n) - ];
right = sortedData[floor(n)];
} {
left = sortedData[ ];
right = sortedData[ ];
}
(left == right) {
( )left;
} {
n - ( )floor(n);
( )left + part * ( )(right - left);
}
}
}
{
x - ax;
y - ay;
bx - ax;
by - ay;
distanceToLineSq(x, y, ax, ay, bx, by, dx0, dy0, dx1, dy1);
}
{
dxAx * dBxAx + dyAy * dByAy;
t /= dBxAx * dBxAx + dByAy * dByAy;
ax;
ay;
(t > ) {
px = bx;
py = by;
} (t > ) {
px = ax + t * dBxAx;
py = ay + t * dByAy;
}
dBxAx = x - px;
dByAy = y - py;
dBxAx * dBxAx + dByAy * dByAy;
}
{
x - ax;
y - ay;
bx - ax;
by - ay;
distanceToInfLineSq(x, y, ax, ay, dx0, dy0, dx1, dy1);
}
{
dxAx * dBxAx + dyAy * dByAy;
t /= dBxAx * dBxAx + dByAy * dByAy;
ax + t * dBxAx;
ay + t * dByAy;
dBxAx = x - px;
dByAy = y - py;
dBxAx * dBxAx + dByAy * dByAy;
}
{
(ax - x) * (by - y) - (ay - y) * (bx - x) >= ? : - ;
}
Vector3f {
(normal == ) {
Vector3f.ZERO;
} (normal.y == ) {
Vector3f.ZERO;
} (normal.y == - ) {
( , , );
} (normal.x == ) {
( , , - );
} (normal.x == - ) {
( , , );
} (normal.z == ) {
( , , );
} {
normal.z == - ? (- , , ) : Vector3f.ZERO;
}
}
String {
(normal == ) {
;
} (normal.y == ) {
;
} (normal.y == - ) {
;
} (normal.x == ) {
;
} (normal.x == - ) {
;
} (normal.z == ) {
;
} {
normal.z == - ? : ;
}
}
{
(value - valueMin) / (valueMax - valueMin);
rangeMin + alpha * (rangeMax - rangeMin);
}
}
com/hypixel/hytale/math/util/NearestBlockUtil.java
package com.hypixel.hytale.math.util;
import com.hypixel.hytale.math.vector.Vector3d;
import com.hypixel.hytale.math.vector.Vector3i;
import java.util.function.BiPredicate;
import java.util.function.DoubleUnaryOperator;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public final class NearestBlockUtil {
public static final IterationElement[] DEFAULT_ELEMENTS = new IterationElement []{new IterationElement (-1 , 0 , 0 , (x) -> 0.0 , (y) -> y, (z) -> z), new IterationElement (1 , 0 , 0 , (x) -> 1.0 , (y) -> y, (z) -> z), new IterationElement (0 , -1 , 0 , (x) -> x, (y) -> 0.0 , (z) -> z), new IterationElement (0 , 1 , 0 , (x) -> x, (y) -> 1.0 , (z) -> z), new IterationElement (0 , 0 , -1 , (x) -> x, (y) -> y, (z) -> 0.0 ), new ( , , , (x) -> x, (y) -> y, (z) -> )};
{
();
}
<T> Vector3i {
findNearestBlock(DEFAULT_ELEMENTS, position.getX(), position.getY(), position.getZ(), validBlock, t);
}
<T> Vector3i {
findNearestBlock(elements, position.getX(), position.getY(), position.getZ(), validBlock, t);
}
<T> Vector3i {
findNearestBlock(DEFAULT_ELEMENTS, x, y, z, validBlock, t);
}
<T> Vector3i {
MathUtil.floor(x);
MathUtil.floor(y);
MathUtil.floor(z);
x % ;
y % ;
z % ;
;
();
/ ;
(IterationElement element : elements) {
rx - element.getX().applyAsDouble(rx);
ry - element.getY().applyAsDouble(ry);
rz - element.getZ().applyAsDouble(rz);
dx * dx + dy * dy + dz * dz;
tmp.assign(blockX + element.getOffsetX(), blockY + element.getOffsetY(), blockZ + element.getOffsetZ());
(dist < nearestDist && validBlock.test(tmp, t)) {
nearestDist = dist;
(nearest == ) {
nearest = ();
}
nearest.assign(tmp);
}
}
nearest;
}
{
ox;
oy;
oz;
DoubleUnaryOperator x;
DoubleUnaryOperator y;
DoubleUnaryOperator z;
{
.ox = ox;
.oy = oy;
.oz = oz;
.x = x;
.y = y;
.z = z;
}
{
.ox;
}
{
.oy;
}
{
.oz;
}
DoubleUnaryOperator {
.x;
}
DoubleUnaryOperator {
.y;
}
DoubleUnaryOperator {
.z;
}
}
}
com/hypixel/hytale/math/util/NumberUtil.java
package com.hypixel.hytale.math.util;
public class NumberUtil {
public NumberUtil () {
}
public static short sum (short a, short b) {
return (short )(a + b);
}
public static short subtract (short a, short b) {
return (short )(a - b);
}
}
com/hypixel/hytale/math/util/TrigMathUtil.java
package com.hypixel.hytale.math.util;
import javax.annotation.Nonnull;
public class TrigMathUtil {
public static final float PI = 3.1415927F ;
public static final float PI_HALF = 1.5707964F ;
public static final float PI_QUARTER = 0.7853982F ;
public static final float PI2 = 6.2831855F ;
public static final float PI4 = 12.566371F ;
public static final float radToDeg = 57.295776F ;
public static final float degToRad = 0.017453292F ;
{
TrigMathUtil.Riven.sin(radians);
}
{
TrigMathUtil.Riven.cos(radians);
}
{
TrigMathUtil.Riven.sin(( )radians);
}
{
TrigMathUtil.Riven.cos(( )radians);
}
{
TrigMathUtil.Icecore.atan2(y, x);
}
{
TrigMathUtil.Icecore.atan2(( )y, ( )x);
}
{
( )Math.atan(d);
}
{
( )Math.asin(d);
}
{
}
{
;
SIN_MASK;
SIN_COUNT;
radFull;
radToIndex;
degFull;
degToIndex;
[] SIN;
[] COS;
{
}
{
SIN[( )(rad * radToIndex) & SIN_MASK];
}
{
COS[( )(rad * radToIndex) & SIN_MASK];
}
{
SIN_MASK = ~(- << SIN_BITS);
SIN_COUNT = SIN_MASK + ;
radFull = ;
degFull = ;
radToIndex = ( )SIN_COUNT / radFull;
degToIndex = ( )SIN_COUNT / degFull;
SIN = [SIN_COUNT];
COS = [SIN_COUNT];
( ; i < SIN_COUNT; ++i) {
SIN[i] = ( )Math.sin(( )((( )i + ) / ( )SIN_COUNT * radFull));
COS[i] = ( )Math.cos(( )((( )i + ) / ( )SIN_COUNT * radFull));
}
( ; i < ; i += ) {
SIN[( )(( )i * degToIndex) & SIN_MASK] = ( )Math.sin(( )i * / );
COS[( )(( )i * degToIndex) & SIN_MASK] = ( )Math.cos(( )i * / );
}
}
}
{
;
;
[] ATAN2 = [ ];
{
}
{
(y < ) {
(x < ) {
y < x ? -ATAN2[( )(x / y * )] - : ATAN2[( )(y / x * )] - ;
} {
y = -y;
y > x ? ATAN2[( )(x / y * )] - : -ATAN2[( )(y / x * )];
}
} (x < ) {
x = -x;
y > x ? ATAN2[( )(x / y * )] + : -ATAN2[( )(y / x * )] + ;
} {
y > x ? -ATAN2[( )(x / y * )] + : ATAN2[( )(y / x * )];
}
}
{
( ; i <= ; ++i) {
( )i / ;
;
x * d;
( )Math.atan2(y, x);
ATAN2[i] = v;
}
}
}
}
com/hypixel/hytale/math/vector/Location.java
package com.hypixel.hytale.math.vector;
import com.hypixel.hytale.math.Axis;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.math.util.TrigMathUtil;
import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class Location {
@Nullable
protected String world;
@Nonnull
protected Vector3d position;
@Nonnull
protected Vector3f rotation;
public Location () {
this ((String)null , new Vector3d (), new Vector3f (0.0F / 0.0F , 0.0F / 0.0F , 0.0F / 0.0F ));
}
public Location (@Nonnull Vector3i position) {
this ((String)null , new Vector3d (position), new Vector3f (0.0F / 0.0F , 0.0F / 0.0F , 0.0F / 0.0F ));
}
public {
(world, (position), ( / , / , / ));
}
{
((String) , (position), ( / , / , / ));
}
{
(world, (position), ( / , / , / ));
}
{
((String) , (x, y, z), ( / , / , / ));
}
{
(world, (x, y, z), ( / , / , / ));
}
{
((String) , (x, y, z), (pitch, yaw, roll));
}
{
(world, (x, y, z), (pitch, yaw, roll));
}
{
((String) , position, rotation);
}
{
((String) , transform.position, transform.rotation);
}
{
(world, transform.position, transform.rotation);
}
{
.world = world;
.position = position;
.rotation = rotation;
}
String {
.world;
}
{
.world = world;
}
Vector3d {
.position;
}
{
.position = position;
}
Vector3f {
.rotation;
}
{
.rotation = rotation;
}
Vector3d {
Transform.getDirection( .rotation.getPitch(), .rotation.getYaw());
}
Vector3i {
.getAxisDirection( .rotation.getPitch(), .rotation.getYaw());
}
Vector3i {
(Float.isNaN(pitch)) {
( );
} (Float.isNaN(yaw)) {
( );
} {
TrigMathUtil.cos(pitch);
len * -TrigMathUtil.sin(yaw);
TrigMathUtil.sin(pitch);
len * -TrigMathUtil.cos(yaw);
(MathUtil.fastRound(x), MathUtil.fastRound(y), MathUtil.fastRound(z));
}
}
Axis {
.getAxisDirection();
(axisDirection.getX() != ) {
Axis.X;
} {
axisDirection.getY() != ? Axis.Y : Axis.Z;
}
}
Transform {
( .position, .rotation);
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(Location)o;
(!Objects.equals( .world, location.world)) {
;
} {
!Objects.equals( .position, location.position) ? : Objects.equals( .rotation, location.rotation);
}
} {
;
}
}
{
.world != ? .world.hashCode() : ;
result = * result + .position.hashCode();
result = * result + .rotation.hashCode();
result;
}
String {
.world;
+ var10000 + + String.valueOf( .position) + + String.valueOf( .rotation) + ;
}
}
package com.hypixel.hytale.math.vector;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.codec.validation.Validators;
import com.hypixel.hytale.math.Axis;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.math.util.TrigMathUtil;
import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class Transform {
@Nonnull
public static final BuilderCodec<Transform> CODEC;
@Nonnull
public static final BuilderCodec<Transform> CODEC_DEGREES;
@Nonnull
protected Vector3d position;
@Nonnull
protected Vector3f rotation;
public static final int X_IS_RELATIVE = 1 ;
public static final int Y_IS_RELATIVE = 2 ;
public static final int Z_IS_RELATIVE ;
;
;
;
;
{
( (), ( / , / , / ));
}
{
( (position), ( / , / , / ));
}
{
( (position), ( / , / , / ));
}
{
( (x, y, z), ( / , / , / ));
}
{
( (x, y, z), (pitch, yaw, roll));
}
{
.position = position;
.rotation = rotation;
}
{
.position.assign(transform.getPosition());
.rotation.assign(transform.getRotation());
}
Vector3d {
.position;
}
{
.position = position;
}
Vector3f {
.rotation;
}
{
.rotation = rotation;
}
Vector3d {
getDirection( .rotation.getPitch(), .rotation.getYaw());
}
Vector3d {
(Float.isNaN(pitch)) {
( );
} (Float.isNaN(yaw)) {
( );
} {
( )TrigMathUtil.cos(pitch);
len * ( )(-TrigMathUtil.sin(yaw));
( )TrigMathUtil.sin(pitch);
len * ( )(-TrigMathUtil.cos(yaw));
(x, y, z);
}
}
Vector3i {
.getAxisDirection( .rotation.getPitch(), .rotation.getYaw());
}
Vector3i {
(Float.isNaN(pitch)) {
( );
} (Float.isNaN(yaw)) {
( );
} {
TrigMathUtil.cos(pitch);
len * -TrigMathUtil.sin(yaw);
TrigMathUtil.sin(pitch);
len * -TrigMathUtil.cos(yaw);
(MathUtil.fastRound(x), MathUtil.fastRound(y), MathUtil.fastRound(z));
}
}
Axis {
.getAxisDirection();
(axisDirection.getX() != ) {
Axis.X;
} {
axisDirection.getY() != ? Axis.Y : Axis.Z;
}
}
Transform {
( .position.clone(), .rotation.clone());
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(Transform)o;
!Objects.equals( .position, transform.position) ? : Objects.equals( .rotation, transform.rotation);
} {
;
}
}
{
.position.hashCode();
result = * result + .rotation.hashCode();
result;
}
String {
String.valueOf( .position);
+ var10000 + + String.valueOf( .rotation) + ;
}
{
(relativeMask != ) {
((relativeMask & ) != ) {
((relativeMask & ) != ) {
transform.getPosition().setX(transform.getPosition().getX() + ( )blockPosition.getX());
}
((relativeMask & ) != ) {
transform.getPosition().setY(transform.getPosition().getY() + ( )blockPosition.getY());
}
((relativeMask & ) != ) {
transform.getPosition().setZ(transform.getPosition().getZ() + ( )blockPosition.getZ());
}
} {
((relativeMask & ) != ) {
transform.getPosition().setX(transform.getPosition().getX() + sourcePosition.getX());
}
((relativeMask & ) != ) {
transform.getPosition().setY(transform.getPosition().getY() + sourcePosition.getY());
}
((relativeMask & ) != ) {
transform.getPosition().setZ(transform.getPosition().getZ() + sourcePosition.getZ());
}
}
((relativeMask & ) != ) {
transform.getRotation().setYaw(transform.getRotation().getYaw() + sourceRotation.getYaw());
}
((relativeMask & ) != ) {
transform.getRotation().setPitch(transform.getRotation().getPitch() + sourceRotation.getPitch());
}
((relativeMask & ) != ) {
transform.getRotation().setRoll(transform.getRotation().getRoll() + sourceRotation.getRoll());
}
}
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(Transform.class, Transform:: ).appendInherited( ( , Codec.DOUBLE), (o, i) -> o.getPosition().x = i, (o) -> o.getPosition().x, (o, p) -> o.getPosition().x = p.getPosition().x).addValidator(Validators.nonNull()).add()).appendInherited( ( , Codec.DOUBLE), (o, i) -> o.getPosition().y = i, (o) -> o.getPosition().y, (o, p) -> o.getPosition().y = p.getPosition().y).addValidator(Validators.nonNull()).add()).appendInherited( ( , Codec.DOUBLE), (o, i) -> o.getPosition().z = i, (o) -> o.getPosition().z, (o, p) -> o.getPosition().z = p.getPosition().z).addValidator(Validators.nonNull()).add()).appendInherited( ( , Codec.FLOAT), (o, i) -> o.getRotation().x = i, (o) -> Float.isNaN(o.getRotation().x) ? : o.getRotation().x, (o, p) -> o.getRotation().x = p.getRotation().x).add()).appendInherited( ( , Codec.FLOAT), (o, i) -> o.getRotation().y = i, (o) -> Float.isNaN(o.getRotation().y) ? : o.getRotation().y, (o, p) -> o.getRotation().y = p.getRotation().y).add()).appendInherited( ( , Codec.FLOAT), (o, i) -> o.getRotation().z = i, (o) -> Float.isNaN(o.getRotation().z) ? : o.getRotation().z, (o, p) -> o.getRotation().z = p.getRotation().z).add()).build();
CODEC_DEGREES = ((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(Transform.class, Transform:: ).appendInherited( ( , Codec.DOUBLE), (o, i) -> o.getPosition().x = i, (o) -> o.getPosition().x, (o, p) -> o.getPosition().x = p.getPosition().x).addValidator(Validators.nonNull()).add()).appendInherited( ( , Codec.DOUBLE), (o, i) -> o.getPosition().y = i, (o) -> o.getPosition().y, (o, p) -> o.getPosition().y = p.getPosition().y).addValidator(Validators.nonNull()).add()).appendInherited( ( , Codec.DOUBLE), (o, i) -> o.getPosition().z = i, (o) -> o.getPosition().z, (o, p) -> o.getPosition().z = p.getPosition().z).addValidator(Validators.nonNull()).add()).appendInherited( ( , Codec.FLOAT), (o, i) -> o.getRotation().x = ( )Math.toRadians(( )i), (o) -> Float.isNaN(o.getRotation().x) ? : ( )Math.toDegrees(( )o.getRotation().x), (o, p) -> o.getRotation().x = p.getRotation().x).add()).appendInherited( ( , Codec.FLOAT), (o, i) -> o.getRotation().y = ( )Math.toRadians(( )i), (o) -> Float.isNaN(o.getRotation().y) ? : ( )Math.toDegrees(( )o.getRotation().y), (o, p) -> o.getRotation().y = p.getRotation().y).add()).appendInherited( ( , Codec.FLOAT), (o, i) -> o.getRotation().z = ( )Math.toRadians(( )i), (o) -> Float.isNaN(o.getRotation().z) ? : ( )Math.toDegrees(( )o.getRotation().z), (o, p) -> o.getRotation().z = p.getRotation().z).add()).build();
}
}
com/hypixel/hytale/math/vector/Vector2d.java
package com.hypixel.hytale.math.vector;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.codec.schema.metadata.ui.UIDisplayMode;
import com.hypixel.hytale.codec.validation.Validators;
import com.hypixel.hytale.math.codec.Vector2dArrayCodec;
import com.hypixel.hytale.math.util.HashUtil;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.math.util.TrigMathUtil;
import java.util.Random;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class Vector2d {
@Nonnull
public static final BuilderCodec<Vector2d> CODEC;
@Deprecated
public static final Vector2dArrayCodec AS_ARRAY_CODEC;
public static final Vector2d ZERO;
public static final Vector2d UP;
public static final Vector2d POS_Y;
public static final Vector2d DOWN;
public static final Vector2d NEG_Y;
public Vector2d RIGHT;
Vector2d POS_X;
Vector2d LEFT;
Vector2d NEG_X;
Vector2d ALL_ONES;
Vector2d[] DIRECTIONS;
x;
y;
hash;
{
( , );
}
{
(v.x, v.y);
}
{
.x = x;
.y = y;
.hash = ;
}
{
random.nextFloat() * ;
random.nextFloat() * ;
.x = ( )(TrigMathUtil.sin(pitch) * TrigMathUtil.cos(yaw));
.y = ( )TrigMathUtil.cos(pitch);
.scale(length);
.hash = ;
}
{
.x;
}
{
.x = x;
.hash = ;
}
{
.y;
}
{
.y = y;
.hash = ;
}
Vector2d {
.x = v.x;
.y = v.y;
.hash = v.hash;
;
}
Vector2d {
.x = v;
.y = v;
.hash = ;
;
}
Vector2d {
.x = v[ ];
.y = v[ ];
.hash = ;
;
}
Vector2d {
.x = ( )v[ ];
.y = ( )v[ ];
.hash = ;
;
}
Vector2d {
.x = x;
.y = y;
.hash = ;
;
}
Vector2d {
.x += v.x;
.y += v.y;
.hash = ;
;
}
Vector2d {
.x += x;
.y += y;
.hash = ;
;
}
Vector2d {
.x += v.x * s;
.y += v.y * s;
.hash = ;
;
}
Vector2d {
.x -= v.x;
.y -= v.y;
.hash = ;
;
}
Vector2d {
.x -= x;
.y -= y;
.hash = ;
;
}
Vector2d {
.x = - .x;
.y = - .y;
.hash = ;
;
}
Vector2d {
.x *= s;
.y *= s;
.hash = ;
;
}
Vector2d {
.x *= p.x;
.y *= p.y;
.hash = ;
;
}
{
.x * other.x + .y * other.y;
}
{
Math.sqrt( .distanceSquaredTo(v));
}
{
Math.sqrt( .distanceSquaredTo(x, y));
}
{
v.x - .x;
v.y - .y;
x0 * x0 + y0 * y0;
}
{
x -= .x;
y -= .y;
x * x + y * y;
}
Vector2d {
.setLength( );
}
{
Math.sqrt( .squaredLength());
}
{
.x * .x + .y * .y;
}
Vector2d {
.scale(newLen / .length());
}
Vector2d {
.length();
maxLength > length ? : .scale(maxLength / length);
}
Vector2d {
.x = Math.floor( .x);
.y = Math.floor( .y);
.hash = ;
;
}
Vector2d {
.x = Math.ceil( .x);
.y = Math.ceil( .y);
.hash = ;
;
}
Vector2d {
.x = MathUtil.clipToZero( .x, epsilon);
.y = MathUtil.clipToZero( .y, epsilon);
.hash = ;
;
}
{
MathUtil.closeToZero( .x, epsilon) && MathUtil.closeToZero( .y, epsilon);
}
{
Double.isFinite( .x) && Double.isFinite( .y);
}
Vector2d {
.hash = ;
;
}
Vector2d {
(Math.max(a.x, b.x), Math.max(a.y, b.y));
}
Vector2d {
(Math.min(a.x, b.x), Math.min(a.y, b.y));
}
Vector2d {
lerpUnclamped(a, b, MathUtil.clamp(t, , ));
}
Vector2d {
(a.x + t * (b.x - a.x), a.y + t * (b.y - a.y));
}
{
Math.sqrt(distanceSquared(x1, y1, x2, y2));
}
{
x1 -= x2;
y1 -= y2;
x1 * x1 + y1 * y1;
}
Vector2d {
( .x, .y);
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(Vector2d)o;
vector2d.x == .x && vector2d.y == .y;
} {
;
}
}
{
( .hash == ) {
.hash = ( )HashUtil.hash(Double.doubleToLongBits( .x), Double.doubleToLongBits( .y));
}
.hash;
}
String {
+ .x + + .y + ;
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(Vector2d.class, Vector2d:: ).metadata(UIDisplayMode.COMPACT)).appendInherited( ( , Codec.DOUBLE), (o, i) -> o.x = i, (o) -> o.x, (o, p) -> o.x = p.x).addValidator(Validators.nonNull()).add()).appendInherited( ( , Codec.DOUBLE), (o, i) -> o.y = i, (o) -> o.y, (o, p) -> o.y = p.y).addValidator(Validators.nonNull()).add()).build();
AS_ARRAY_CODEC = ();
ZERO = ( , );
UP = ( , );
POS_Y = UP;
DOWN = ( , - );
NEG_Y = DOWN;
RIGHT = ( , );
POS_X = RIGHT;
LEFT = (- , );
NEG_X = LEFT;
ALL_ONES = ( , );
DIRECTIONS = []{UP, DOWN, LEFT, RIGHT};
}
}
com/hypixel/hytale/math/vector/Vector2i.java
package com.hypixel.hytale.math.vector;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.codec.schema.metadata.ui.UIDisplayMode;
import com.hypixel.hytale.codec.validation.Validators;
import com.hypixel.hytale.math.util.HashUtil;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class Vector2i {
@Nonnull
public static final BuilderCodec<Vector2i> CODEC;
public static final Vector2i ZERO;
public static final Vector2i UP;
public static final Vector2i POS_Y;
public static final Vector2i DOWN;
public static final Vector2i NEG_Y;
public static final Vector2i RIGHT;
public static final Vector2i POS_X;
public static final Vector2i LEFT;
public static final Vector2i NEG_X;
public static Vector2i ALL_ONES;
Vector2i[] DIRECTIONS;
x;
y;
hash;
{
( , );
}
{
(v.x, v.y);
}
{
.x = x;
.y = y;
.hash = ;
}
{
.x;
}
{
.x = x;
.hash = ;
}
{
.y;
}
{
.y = y;
.hash = ;
}
Vector2i {
.x = v.x;
.y = v.y;
.hash = v.hash;
;
}
Vector2i {
.x = v;
.y = v;
.hash = ;
;
}
Vector2i {
.x = v[ ];
.y = v[ ];
.hash = ;
;
}
Vector2i {
.x = x;
.y = y;
.hash = ;
;
}
Vector2i {
.x += v.x;
.y += v.y;
.hash = ;
;
}
Vector2i {
.x += x;
.y += y;
.hash = ;
;
}
Vector2i {
.x += v.x * s;
.y += v.y * s;
.hash = ;
;
}
Vector2i {
.x -= v.x;
.y -= v.y;
.hash = ;
;
}
Vector2i {
.x -= x;
.y -= y;
.hash = ;
;
}
Vector2i {
.x = - .x;
.y = - .y;
.hash = ;
;
}
Vector2i {
.x *= s;
.y *= s;
.hash = ;
;
}
Vector2i {
.x *= p.x;
.y *= p.y;
.hash = ;
;
}
{
.x * other.x + .y * other.y;
}
{
Math.sqrt(( ) .distanceSquaredTo(v));
}
{
Math.sqrt(( ) .distanceSquaredTo(x, y));
}
{
v.x - .x;
v.y - .y;
x0 * x0 + y0 * y0;
}
{
x -= .x;
y -= .y;
x * x + y * y;
}
Vector2i {
.setLength( );
}
{
Math.sqrt( .squaredLength());
}
{
( )( .x * .x + .y * .y);
}
Vector2i {
( )newLen / .length();
.x = ( )(( ) .x * scale);
.y = ( )(( ) .y * scale);
.hash = ;
;
}
Vector2i {
.length();
(( )maxLength > length) {
;
} {
( )maxLength / length;
.x = ( )(( ) .x * scale);
.y = ( )(( ) .y * scale);
.hash = ;
;
}
}
Vector2i {
.hash = ;
;
}
Vector2i {
( .x, .y);
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(Vector2i)o;
vector2i.x == .x && vector2i.y == .y;
} {
;
}
}
{
( .hash == ) {
.hash = ( )HashUtil.hash(( ) .x, ( ) .y);
}
.hash;
}
String {
+ .x + + .y + ;
}
Vector2i {
(Math.max(a.x, b.x), Math.max(a.y, b.y));
}
Vector2i {
(Math.min(a.x, b.x), Math.min(a.y, b.y));
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(Vector2i.class, Vector2i:: ).metadata(UIDisplayMode.COMPACT)).appendInherited( ( , Codec.INTEGER), (o, i) -> o.x = i, (o) -> o.x, (o, p) -> o.x = p.x).addValidator(Validators.nonNull()).add()).appendInherited( ( , Codec.INTEGER), (o, i) -> o.y = i, (o) -> o.y, (o, p) -> o.y = p.y).addValidator(Validators.nonNull()).add()).build();
ZERO = ( , );
UP = ( , );
POS_Y = UP;
DOWN = ( , - );
NEG_Y = DOWN;
RIGHT = ( , );
POS_X = RIGHT;
LEFT = (- , );
NEG_X = LEFT;
ALL_ONES = ( , );
DIRECTIONS = []{UP, DOWN, LEFT, RIGHT};
}
}
com/hypixel/hytale/math/vector/Vector2l.java
package com.hypixel.hytale.math.vector;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.codec.schema.metadata.ui.UIDisplayMode;
import com.hypixel.hytale.codec.validation.Validators;
import com.hypixel.hytale.math.util.HashUtil;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class Vector2l {
@Nonnull
public static final BuilderCodec<Vector2l> CODEC;
public static final Vector2l ZERO;
public static final Vector2l UP;
public static final Vector2l POS_Y;
public static final Vector2l DOWN;
public static final Vector2l NEG_Y;
public static final Vector2l RIGHT;
public static final Vector2l POS_X;
public static final Vector2l LEFT;
public static final Vector2l NEG_X;
public static Vector2l ALL_ONES;
Vector2l[] DIRECTIONS;
x;
y;
hash;
{
( , );
}
{
(v.x, v.y);
}
{
.x = x;
.y = y;
.hash = ;
}
{
.x;
}
{
.x = x;
.hash = ;
}
{
.y;
}
{
.y = y;
.hash = ;
}
Vector2l {
.x = v.x;
.y = v.y;
.hash = v.hash;
;
}
Vector2l {
.x = v;
.y = v;
.hash = ;
;
}
Vector2l {
.x = v[ ];
.y = v[ ];
.hash = ;
;
}
Vector2l {
.x = x;
.y = y;
.hash = ;
;
}
Vector2l {
.x += v.x;
.y += v.y;
.hash = ;
;
}
Vector2l {
.x += x;
.y += y;
.hash = ;
;
}
Vector2l {
.x += v.x * s;
.y += v.y * s;
.hash = ;
;
}
Vector2l {
.x -= v.x;
.y -= v.y;
.hash = ;
;
}
Vector2l {
.x -= x;
.y -= y;
.hash = ;
;
}
Vector2l {
.x = - .x;
.y = - .y;
.hash = ;
;
}
Vector2l {
.x *= s;
.y *= s;
.hash = ;
;
}
Vector2l {
.x = ( )(( ) .x * s);
.y = ( )(( ) .y * s);
.hash = ;
;
}
Vector2l {
.x *= p.x;
.y *= p.y;
.hash = ;
;
}
{
.x * other.x + .y * other.y;
}
{
Math.sqrt(( ) .distanceSquaredTo(v));
}
{
Math.sqrt(( ) .distanceSquaredTo(x, y));
}
{
v.x - .x;
v.y - .y;
x0 * x0 + y0 * y0;
}
{
x - .x;
y - .y;
dx * dx + dy * dy;
}
Vector2l {
.setLength( );
}
{
Math.sqrt(( ) .squaredLength());
}
{
.x * .x + .y * .y;
}
Vector2l {
.scale(( )newLen / .length());
}
Vector2l {
.length();
( )maxLength > length ? : .scale(( )maxLength / length);
}
Vector2l {
.hash = ;
;
}
Vector2l {
( .x, .y);
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(Vector2l)o;
vector2l.x == .x && vector2l.y == .y;
} {
;
}
}
{
( .hash == ) {
.hash = ( )HashUtil.hash( .x, .y);
}
.hash;
}
String {
+ .x + + .y + ;
}
Vector2l {
(Math.max(a.x, b.x), Math.max(a.y, b.y));
}
Vector2l {
(Math.min(a.x, b.x), Math.min(a.y, b.y));
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(Vector2l.class, Vector2l:: ).metadata(UIDisplayMode.COMPACT)).appendInherited( ( , Codec.LONG), (o, i) -> o.x = i, (o) -> o.x, (o, p) -> o.x = p.x).addValidator(Validators.nonNull()).add()).appendInherited( ( , Codec.LONG), (o, i) -> o.y = i, (o) -> o.y, (o, p) -> o.y = p.y).addValidator(Validators.nonNull()).add()).build();
ZERO = ( , );
UP = ( , );
POS_Y = UP;
DOWN = ( , - );
NEG_Y = DOWN;
RIGHT = ( , );
POS_X = RIGHT;
LEFT = (- , );
NEG_X = LEFT;
ALL_ONES = ( , );
DIRECTIONS = []{UP, DOWN, LEFT, RIGHT};
}
}
com/hypixel/hytale/math/vector/Vector3d.java
package com.hypixel.hytale.math.vector;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.codec.schema.metadata.ui.UIDisplayMode;
import com.hypixel.hytale.codec.validation.Validators;
import com.hypixel.hytale.math.codec.Vector3dArrayCodec;
import com.hypixel.hytale.math.util.HashUtil;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.math.util.TrigMathUtil;
import java.util.Random;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class Vector3d {
@Nonnull
public static final BuilderCodec<Vector3d> CODEC;
@Deprecated
public static final Vector3dArrayCodec AS_ARRAY_CODEC;
public static final Vector3d ZERO;
public static final Vector3d UP;
public static final Vector3d POS_Y;
public static final Vector3d DOWN;
public static final Vector3d NEG_Y;
public Vector3d FORWARD;
Vector3d NEG_Z;
Vector3d NORTH;
Vector3d BACKWARD;
Vector3d POS_Z;
Vector3d SOUTH;
Vector3d RIGHT;
Vector3d POS_X;
Vector3d EAST;
Vector3d LEFT;
Vector3d NEG_X;
Vector3d WEST;
Vector3d ALL_ONES;
Vector3d MIN;
Vector3d MAX;
Vector3d[] BLOCK_SIDES;
Vector3d[] BLOCK_EDGES;
Vector3d[] BLOCK_CORNERS;
Vector3d[][] BLOCK_PARTS;
Vector3d[] CARDINAL_DIRECTIONS;
x;
y;
z;
hash;
{
( , , );
}
{
(v.x, v.y, v.z);
}
{
(( )v.x, ( )v.y, ( )v.z);
}
{
.x = x;
.y = y;
.z = z;
.hash = ;
}
{
();
.assign(( )yaw, ( )pitch);
}
{
(random.nextFloat() * , random.nextFloat() * );
.scale(length);
}
{
.x;
}
{
.x = x;
.hash = ;
}
{
.y;
}
{
.y = y;
.hash = ;
}
{
.z;
}
{
.z = z;
.hash = ;
}
Vector3d {
.x = v.x;
.y = v.y;
.z = v.z;
.hash = v.hash;
;
}
Vector3d {
.x = v;
.y = v;
.z = v;
.hash = ;
;
}
Vector3d {
.x = v[ ];
.y = v[ ];
.z = v[ ];
.hash = ;
;
}
Vector3d {
.x = ( )v[ ];
.y = ( )v[ ];
.z = ( )v[ ];
.hash = ;
;
}
Vector3d {
( )TrigMathUtil.cos(pitch);
len * ( )(-TrigMathUtil.sin(yaw));
( )TrigMathUtil.sin(pitch);
len * ( )(-TrigMathUtil.cos(yaw));
.assign(x, y, z);
}
Vector3d {
.x = x;
.y = y;
.z = z;
.hash = ;
;
}
Vector3d {
.x += v.x;
.y += v.y;
.z += v.z;
.hash = ;
;
}
Vector3d {
.x += ( )v.x;
.y += ( )v.y;
.z += ( )v.z;
.hash = ;
;
}
Vector3d {
.x += x;
.y += y;
.z += z;
.hash = ;
;
}
Vector3d {
.x += value;
.y += value;
.z += value;
.hash = ;
;
}
Vector3d {
.x += v.x * s;
.y += v.y * s;
.z += v.z * s;
.hash = ;
;
}
Vector3d {
.x -= v.x;
.y -= v.y;
.z -= v.z;
.hash = ;
;
}
Vector3d {
.x -= ( )v.x;
.y -= ( )v.y;
.z -= ( )v.z;
.hash = ;
;
}
Vector3d {
.x -= x;
.y -= y;
.z -= z;
.hash = ;
;
}
Vector3d {
.x -= value;
.y -= value;
.z -= value;
.hash = ;
;
}
Vector3d {
.x = - .x;
.y = - .y;
.z = - .z;
.hash = ;
;
}
Vector3d {
.x *= s;
.y *= s;
.z *= s;
.hash = ;
;
}
Vector3d {
.x *= p.x;
.y *= p.y;
.z *= p.z;
.hash = ;
;
}
Vector3d {
.y * v.z - .z * v.y;
.z * v.x - .x * v.z;
.x * v.y - .y * v.x;
(x0, y0, z0);
}
Vector3d {
res.assign( .y * v.z - .z * v.y, .z * v.x - .x * v.z, .x * v.y - .y * v.x);
;
}
{
.x * other.x + .y * other.y + .z * other.z;
}
{
Math.sqrt( .distanceSquaredTo(v));
}
{
Math.sqrt( .distanceSquaredTo(v));
}
{
Math.sqrt( .distanceSquaredTo(x, y, z));
}
{
v.x - .x;
v.y - .y;
v.z - .z;
x0 * x0 + y0 * y0 + z0 * z0;
}
{
( )v.x - .x;
( )v.y - .y;
( )v.z - .z;
x0 * x0 + y0 * y0 + z0 * z0;
}
{
x -= .x;
y -= .y;
z -= .z;
x * x + y * y + z * z;
}
Vector3d {
.setLength( );
}
{
Math.sqrt( .squaredLength());
}
{
.x * .x + .y * .y + .z * .z;
}
Vector3d {
.scale(newLen / .length());
}
Vector3d {
.length();
maxLength > length ? : .scale(maxLength / length);
}
Vector3d {
( )TrigMathUtil.cos(angle);
( )TrigMathUtil.sin(angle);
.y * cos - .z * sin;
.y * sin + .z * cos;
.y = cy;
.z = cz;
;
}
Vector3d {
( )TrigMathUtil.cos(angle);
( )TrigMathUtil.sin(angle);
.x * cos + .z * sin;
.x * -sin + .z * cos;
.x = cx;
.z = cz;
;
}
Vector3d {
( )TrigMathUtil.cos(angle);
( )TrigMathUtil.sin(angle);
.x * cos - .y * sin;
.x * sin + .y * cos;
.x = cx;
.y = cy;
;
}
Vector3d {
.x = ( )MathUtil.fastFloor( .x);
.y = ( )MathUtil.fastFloor( .y);
.z = ( )MathUtil.fastFloor( .z);
.hash = ;
;
}
Vector3d {
.x = ( )MathUtil.fastCeil( .x);
.y = ( )MathUtil.fastCeil( .y);
.z = ( )MathUtil.fastCeil( .z);
.hash = ;
;
}
Vector3d {
.x = MathUtil.clipToZero( .x, epsilon);
.y = MathUtil.clipToZero( .y, epsilon);
.z = MathUtil.clipToZero( .z, epsilon);
.hash = ;
;
}
{
MathUtil.closeToZero( .x, epsilon) && MathUtil.closeToZero( .y, epsilon) && MathUtil.closeToZero( .z, epsilon);
}
{
.x - ( )x;
.y - ( )y;
.z - ( )z;
dx >= && dx < && dy >= && dy < && dz >= && dz < ;
}
{
Double.isFinite( .x) && Double.isFinite( .y) && Double.isFinite( .z);
}
Vector3d {
.hash = ;
;
}
Vector3d {
( .x, .y, .z);
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(Vector3d)o;
vector3d.x == .x && vector3d.y == .y && vector3d.z == .z;
} {
;
}
}
{
(o == ) {
;
} {
o.x == .x && o.y == .y && o.z == .z;
}
}
{
( .hash == ) {
.hash = ( )HashUtil.hash(Double.doubleToLongBits( .x), Double.doubleToLongBits( .y), Double.doubleToLongBits( .z));
}
.hash;
}
String {
+ .x + + .y + + .z + ;
}
Vector3d {
(Math.max(a.x, b.x), Math.max(a.y, b.y), Math.max(a.z, b.z));
}
Vector3d {
(Math.min(a.x, b.x), Math.min(a.y, b.y), Math.min(a.z, b.z));
}
Vector3d {
lerpUnclamped(a, b, MathUtil.clamp(t, , ));
}
Vector3d {
(a.x + t * (b.x - a.x), a.y + t * (b.y - a.y), a.z + t * (b.z - a.z));
}
Vector3d {
to.clone().subtract(from).normalize();
}
Vector3d {
to.clone().subtract(from).normalize();
}
Vector3d {
( ()).add(one).add(two);
}
Vector3d {
( ()).add(one).add(two).add(three);
}
String {
v == ? : v.x + + v.y + + v.z;
}
Vector3i {
(MathUtil.floor( .x), MathUtil.floor( .y), MathUtil.floor( .z));
}
Vector3f {
(( ) .x, ( ) .y, ( ) .z);
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(Vector3d.class, Vector3d:: ).metadata(UIDisplayMode.COMPACT)).appendInherited( ( , Codec.DOUBLE), (o, i) -> o.x = i, (o) -> o.x, (o, p) -> o.x = p.x).addValidator(Validators.nonNull()).add()).appendInherited( ( , Codec.DOUBLE), (o, i) -> o.y = i, (o) -> o.y, (o, p) -> o.y = p.y).addValidator(Validators.nonNull()).add()).appendInherited( ( , Codec.DOUBLE), (o, i) -> o.z = i, (o) -> o.z, (o, p) -> o.z = p.z).addValidator(Validators.nonNull()).add()).build();
AS_ARRAY_CODEC = ();
ZERO = ( , , );
UP = ( , , );
POS_Y = UP;
DOWN = ( , - , );
NEG_Y = DOWN;
FORWARD = ( , , - );
NEG_Z = FORWARD;
NORTH = FORWARD;
BACKWARD = ( , , );
POS_Z = BACKWARD;
SOUTH = BACKWARD;
RIGHT = ( , , );
POS_X = RIGHT;
EAST = RIGHT;
LEFT = (- , , );
NEG_X = LEFT;
WEST = LEFT;
ALL_ONES = ( , , );
MIN = (- , - , - );
MAX = ( , , );
BLOCK_SIDES = []{UP, DOWN, FORWARD, BACKWARD, LEFT, RIGHT};
BLOCK_EDGES = []{add(UP, FORWARD), add(DOWN, FORWARD), add(UP, BACKWARD), add(DOWN, BACKWARD), add(UP, LEFT), add(DOWN, LEFT), add(UP, RIGHT), add(DOWN, RIGHT), add(FORWARD, LEFT), add(FORWARD, RIGHT), add(BACKWARD, LEFT), add(BACKWARD, RIGHT)};
BLOCK_CORNERS = []{add(UP, FORWARD, LEFT), add(UP, FORWARD, RIGHT), add(DOWN, FORWARD, LEFT), add(DOWN, FORWARD, RIGHT), add(UP, BACKWARD, LEFT), add(UP, BACKWARD, RIGHT), add(DOWN, BACKWARD, LEFT), add(DOWN, BACKWARD, RIGHT)};
BLOCK_PARTS = [][]{BLOCK_SIDES, BLOCK_EDGES, BLOCK_CORNERS};
CARDINAL_DIRECTIONS = []{NORTH, SOUTH, EAST, WEST};
}
}
com/hypixel/hytale/math/vector/Vector3f.java
package com.hypixel.hytale.math.vector;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.codec.schema.metadata.ui.UIDisplayMode;
import com.hypixel.hytale.math.Axis;
import com.hypixel.hytale.math.util.HashUtil;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.math.util.TrigMathUtil;
import java.util.Random;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class Vector3f {
@Nonnull
public static final BuilderCodec<Vector3f> CODEC;
@Nonnull
public static final BuilderCodec<Vector3f> ROTATION;
public static final Vector3f ZERO;
public static final Vector3f UP;
public static final Vector3f POS_Y;
public static final Vector3f DOWN;
public static final Vector3f NEG_Y;
public static final Vector3f FORWARD;
public static Vector3f NEG_Z;
Vector3f NORTH;
Vector3f BACKWARD;
Vector3f POS_Z;
Vector3f SOUTH;
Vector3f RIGHT;
Vector3f POS_X;
Vector3f EAST;
Vector3f LEFT;
Vector3f NEG_X;
Vector3f WEST;
Vector3f ALL_ONES;
Vector3f MIN;
Vector3f MAX;
Vector3f NaN;
Vector3f[] BLOCK_SIDES;
Vector3f[] BLOCK_EDGES;
Vector3f[] BLOCK_CORNERS;
Vector3f[][] BLOCK_PARTS;
Vector3f[] CARDINAL_DIRECTIONS;
x;
y;
z;
hash;
{
( , , );
}
{
(v.x, v.y, v.z);
}
{
(( )v.x, ( )v.y, ( )v.z);
}
{
.x = x;
.y = y;
.z = z;
.hash = ;
}
{
();
.assign(yaw, pitch);
}
{
(random.nextFloat() * , random.nextFloat() * );
.scale(length);
}
{
.x;
}
{
.x;
}
{
.x = x;
.hash = ;
}
{
.x = pitch;
.hash = ;
}
{
.y;
}
{
.y;
}
{
.y = y;
.hash = ;
}
{
.y = yaw;
.hash = ;
}
{
.z;
}
{
.z;
}
{
.z = z;
.hash = ;
}
{
.z = roll;
.hash = ;
}
Vector3f {
.x = v.x;
.y = v.y;
.z = v.z;
.hash = v.hash;
;
}
Vector3f {
.x = v;
.y = v;
.z = v;
.hash = ;
;
}
Vector3f {
.x = v[ ];
.y = v[ ];
.z = v[ ];
.hash = ;
;
}
Vector3f {
TrigMathUtil.cos(pitch);
len * -TrigMathUtil.sin(yaw);
TrigMathUtil.sin(pitch);
len * -TrigMathUtil.cos(yaw);
.assign(x, y, z);
}
Vector3f {
.x = x;
.y = y;
.z = z;
.hash = ;
;
}
Vector3f {
.x += v.x;
.y += v.y;
.z += v.z;
.hash = ;
;
}
Vector3f {
.x += ( )v.x;
.y += ( )v.y;
.z += ( )v.z;
.hash = ;
;
}
Vector3f {
.x += x;
.y += y;
.z += z;
.hash = ;
;
}
{
.x += pitch;
.hash = ;
}
{
.y += yaw;
.hash = ;
}
{
.z += roll;
.hash = ;
}
Vector3f {
.x += v.x * s;
.y += v.y * s;
.z += v.z * s;
.hash = ;
;
}
Vector3f {
.x -= v.x;
.y -= v.y;
.z -= v.z;
.hash = ;
;
}
Vector3f {
.x -= ( )v.x;
.y -= ( )v.y;
.z -= ( )v.z;
.hash = ;
;
}
Vector3f {
.x -= x;
.y -= y;
.z -= z;
.hash = ;
;
}
{
* ( )angle;
(axis) {
X -> .setPitch( .getPitch() + rad);
Y -> .setYaw( .getYaw() + rad);
Z -> .setRoll( .getRoll() + rad);
}
}
{
.addRotationOnAxis(axis, );
}
Vector3f {
.x = - .x;
.y = - .y;
.z = - .z;
.hash = ;
;
}
Vector3f {
.x *= s;
.y *= s;
.z *= s;
.hash = ;
;
}
Vector3f {
.x *= p.x;
.y *= p.y;
.z *= p.z;
.hash = ;
;
}
Vector3f {
.y * v.z - .z * v.y;
.z * v.x - .x * v.z;
.x * v.y - .y * v.x;
(x0, y0, z0);
}
Vector3f {
res.assign( .y * v.z - .z * v.y, .z * v.x - .x * v.z, .x * v.y - .y * v.x);
;
}
{
.x * other.x + .y * other.y + .z * other.z;
}
{
( )Math.sqrt(( ) .distanceSquaredTo(v));
}
{
( )Math.sqrt(( ) .distanceSquaredTo(v));
}
{
( )Math.sqrt(( ) .distanceSquaredTo(x, y, z));
}
{
v.x - .x;
v.y - .y;
v.z - .z;
x0 * x0 + y0 * y0 + z0 * z0;
}
{
( )v.x - .x;
( )v.y - .y;
( )v.z - .z;
x0 * x0 + y0 * y0 + z0 * z0;
}
{
x - .x;
y - .y;
z - .z;
dx * dx + dy * dy + dz * dz;
}
Vector3f {
.setLength( );
}
{
( )Math.sqrt(( ) .squaredLength());
}
{
.x * .x + .y * .y + .z * .z;
}
Vector3f {
.scale(newLen / .length());
}
Vector3f {
.length();
maxLength > length ? : .scale(maxLength / length);
}
Vector3f {
TrigMathUtil.cos(angle);
TrigMathUtil.sin(angle);
.y * cos - .z * sin;
.y * sin + .z * cos;
.y = cy;
.z = cz;
;
}
Vector3f {
TrigMathUtil.cos(angle);
TrigMathUtil.sin(angle);
.x * cos + .z * sin;
.x * -sin + .z * cos;
.x = cx;
.z = cz;
;
}
Vector3f {
TrigMathUtil.cos(angle);
TrigMathUtil.sin(angle);
.x * cos - .y * sin;
.x * sin + .y * cos;
.x = cx;
.y = cy;
;
}
Vector3f {
.x = ( )MathUtil.fastFloor( .x);
.y = ( )MathUtil.fastFloor( .y);
.z = ( )MathUtil.fastFloor( .z);
.hash = ;
;
}
Vector3f {
.x = ( )MathUtil.fastCeil( .x);
.y = ( )MathUtil.fastCeil( .y);
.z = ( )MathUtil.fastCeil( .z);
.hash = ;
;
}
Vector3f {
.x = MathUtil.clipToZero( .x, epsilon);
.y = MathUtil.clipToZero( .y, epsilon);
.z = MathUtil.clipToZero( .z, epsilon);
.hash = ;
;
}
{
MathUtil.closeToZero( .x, epsilon) && MathUtil.closeToZero( .y, epsilon) && MathUtil.closeToZero( .z, epsilon);
}
{
.x - ( )x;
.y - ( )y;
.z - ( )z;
dx >= && dx < && dy >= && dy < && dz >= && dz < ;
}
{
Float.isFinite( .x) && Float.isFinite( .y) && Float.isFinite( .z);
}
Vector3f {
.hash = ;
;
}
Vector3f {
( .x, .y, .z);
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(Vector3f)o;
(vector3f.x == .x && vector3f.y == .y && vector3f.z == .z) {
;
} {
Float.isNaN(vector3f.x) && Float.isNaN( .x) && Float.isNaN(vector3f.y) && Float.isNaN( .y) && Float.isNaN(vector3f.z) && Float.isNaN( .z);
}
} {
;
}
}
{
(o == ) {
;
} (o.x == .x && o.y == .y && o.z == .z) {
;
} {
Float.isNaN(o.x) && Float.isNaN( .x) && Float.isNaN(o.y) && Float.isNaN( .y) && Float.isNaN(o.z) && Float.isNaN( .z);
}
}
{
( .hash == ) {
.hash = ( )HashUtil.hash(( )Float.floatToIntBits( .x), ( )Float.floatToIntBits( .y), ( )Float.floatToIntBits( .z));
}
.hash;
}
String {
+ .x + + .y + + .z + ;
}
Vector3d {
(( ) .x, ( ) .y, ( ) .z);
}
Vector3f {
(Math.max(a.x, b.x), Math.max(a.y, b.y), Math.max(a.z, b.z));
}
Vector3f {
(Math.min(a.x, b.x), Math.min(a.y, b.y), Math.min(a.z, b.z));
}
Vector3f {
lerpUnclamped(a, b, MathUtil.clamp(t, , ));
}
Vector3f {
(a.x + t * (b.x - a.x), a.y + t * (b.y - a.y), a.z + t * (b.z - a.z));
}
Vector3f {
lerpAngle(a, b, t, ());
}
Vector3f {
target.assign(MathUtil.lerpAngle(a.x, b.x, t), MathUtil.lerpAngle(a.y, b.y, t), MathUtil.lerpAngle(a.z, b.z, t));
target;
}
Vector3f {
to.clone().subtract(from).normalize();
}
Vector3f {
( ()).add(one).add(two);
}
Vector3f {
( ()).add(one).add(two).add(three);
}
Vector3f {
lookAt(relative, ());
}
Vector3f {
(!MathUtil.closeToZero(relative.x) || !MathUtil.closeToZero(relative.z)) {
TrigMathUtil.atan2(( )(-relative.x), ( )(-relative.z));
result.setY(MathUtil.wrapAngle(yaw));
}
relative.squaredLength();
(length > ) {
- ( )Math.acos(relative.y / Math.sqrt(length));
result.setX(MathUtil.clamp(pitch, - + MathUtil.PITCH_EDGE_PADDING, - MathUtil.PITCH_EDGE_PADDING));
}
result;
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(Vector3f.class, () -> ( / , / , / )).metadata(UIDisplayMode.COMPACT)).appendInherited( ( , Codec.FLOAT), (o, i) -> o.x = i, (o) -> Float.isNaN(o.x) ? : o.x, (o, p) -> o.x = p.x).add()).appendInherited( ( , Codec.FLOAT), (o, i) -> o.y = i, (o) -> Float.isNaN(o.y) ? : o.y, (o, p) -> o.y = p.y).add()).appendInherited( ( , Codec.FLOAT), (o, i) -> o.z = i, (o) -> Float.isNaN(o.z) ? : o.z, (o, p) -> o.z = p.z).add()).build();
ROTATION = ((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(Vector3f.class, () -> ( / , / , / )).metadata(UIDisplayMode.COMPACT)).appendInherited( ( , Codec.FLOAT), (o, i) -> o.x = i, (o) -> Float.isNaN(o.x) ? : o.x, (o, p) -> o.x = p.x).add()).appendInherited( ( , Codec.FLOAT), (o, i) -> o.y = i, (o) -> Float.isNaN(o.y) ? : o.y, (o, p) -> o.y = p.y).add()).appendInherited( ( , Codec.FLOAT), (o, i) -> o.z = i, (o) -> Float.isNaN(o.z) ? : o.z, (o, p) -> o.z = p.z).add()).build();
ZERO = ( , , );
UP = ( , , );
POS_Y = UP;
DOWN = ( , - , );
NEG_Y = DOWN;
FORWARD = ( , , - );
NEG_Z = FORWARD;
NORTH = FORWARD;
BACKWARD = ( , , );
POS_Z = BACKWARD;
SOUTH = BACKWARD;
RIGHT = ( , , );
POS_X = RIGHT;
EAST = RIGHT;
LEFT = (- , , );
NEG_X = LEFT;
WEST = LEFT;
ALL_ONES = ( , , );
MIN = (- , - , - );
MAX = ( , , );
NaN = ( / , / , / );
BLOCK_SIDES = []{UP, DOWN, FORWARD, BACKWARD, LEFT, RIGHT};
BLOCK_EDGES = []{add(UP, FORWARD), add(DOWN, FORWARD), add(UP, BACKWARD), add(DOWN, BACKWARD), add(UP, LEFT), add(DOWN, LEFT), add(UP, RIGHT), add(DOWN, RIGHT), add(FORWARD, LEFT), add(FORWARD, RIGHT), add(BACKWARD, LEFT), add(BACKWARD, RIGHT)};
BLOCK_CORNERS = []{add(UP, FORWARD, LEFT), add(UP, FORWARD, RIGHT), add(DOWN, FORWARD, LEFT), add(DOWN, FORWARD, RIGHT), add(UP, BACKWARD, LEFT), add(UP, BACKWARD, RIGHT), add(DOWN, BACKWARD, LEFT), add(DOWN, BACKWARD, RIGHT)};
BLOCK_PARTS = [][]{BLOCK_SIDES, BLOCK_EDGES, BLOCK_CORNERS};
CARDINAL_DIRECTIONS = []{NORTH, SOUTH, EAST, WEST};
}
}
com/hypixel/hytale/math/vector/Vector3i.java
package com.hypixel.hytale.math.vector;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.codec.schema.metadata.ui.UIDisplayMode;
import com.hypixel.hytale.codec.validation.Validators;
import com.hypixel.hytale.math.util.HashUtil;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class Vector3i {
@Nonnull
public static final BuilderCodec<Vector3i> CODEC;
public static final Vector3i ZERO;
public static final Vector3i UP;
public static final Vector3i POS_Y;
public static final Vector3i DOWN;
public static final Vector3i NEG_Y;
public static final Vector3i FORWARD;
public static final Vector3i NEG_Z;
public static final Vector3i NORTH;
public static final Vector3i BACKWARD;
public static Vector3i POS_Z;
Vector3i SOUTH;
Vector3i RIGHT;
Vector3i POS_X;
Vector3i EAST;
Vector3i LEFT;
Vector3i NEG_X;
Vector3i WEST;
Vector3i ALL_ONES;
Vector3i MIN;
Vector3i MAX;
Vector3i[] BLOCK_SIDES;
Vector3i[] BLOCK_EDGES;
Vector3i[] BLOCK_CORNERS;
Vector3i[][] BLOCK_PARTS;
Vector3i[] CARDINAL_DIRECTIONS;
x;
y;
z;
hash;
{
( , , );
}
{
(v.x, v.y, v.z);
}
{
.x = x;
.y = y;
.z = z;
.hash = ;
}
{
.x;
}
{
.x = x;
.hash = ;
}
{
.y;
}
{
.y = y;
.hash = ;
}
{
.z;
}
{
.z = z;
.hash = ;
}
Vector3i {
.x = v.x;
.y = v.y;
.z = v.z;
.hash = v.hash;
;
}
Vector3i {
.x = v;
.y = v;
.z = v;
.hash = ;
;
}
Vector3i {
.x = v[ ];
.y = v[ ];
.z = v[ ];
.hash = ;
;
}
Vector3i {
.x = x;
.y = y;
.z = z;
.hash = ;
;
}
Vector3i {
.x += v.x;
.y += v.y;
.z += v.z;
.hash = ;
;
}
Vector3i {
.x += x;
.y += y;
.z += z;
.hash = ;
;
}
Vector3i {
.x += v.x * s;
.y += v.y * s;
.z += v.z * s;
.hash = ;
;
}
Vector3i {
.x -= v.x;
.y -= v.y;
.z -= v.z;
.hash = ;
;
}
Vector3i {
.x -= x;
.y -= y;
.z -= z;
.hash = ;
;
}
Vector3i {
.x = - .x;
.y = - .y;
.z = - .z;
.hash = ;
;
}
Vector3i {
.x *= s;
.y *= s;
.z *= s;
.hash = ;
;
}
Vector3i {
.x = ( )(( ) .x * s);
.y = ( )(( ) .y * s);
.z = ( )(( ) .z * s);
.hash = ;
;
}
Vector3i {
.x *= p.x;
.y *= p.y;
.z *= p.z;
.hash = ;
;
}
Vector3i {
.y * v.z - .z * v.y;
.z * v.x - .x * v.z;
.x * v.y - .y * v.x;
(x0, y0, z0);
}
Vector3i {
res.assign( .y * v.z - .z * v.y, .z * v.x - .x * v.z, .x * v.y - .y * v.x);
;
}
{
.x * other.x + .y * other.y + .z * other.z;
}
{
Math.sqrt(( ) .distanceSquaredTo(v));
}
{
Math.sqrt(( ) .distanceSquaredTo(x, y, z));
}
{
v.x - .x;
v.y - .y;
v.z - .z;
x0 * x0 + y0 * y0 + z0 * z0;
}
{
x - .x;
y - .y;
z - .z;
dx * dx + dy * dy + dz * dz;
}
Vector3i {
.setLength( );
}
{
Math.sqrt(( ) .squaredLength());
}
{
.x * .x + .y * .y + .z * .z;
}
Vector3i {
.scale(( )newLen / .length());
}
Vector3i {
.length();
( )maxLength > length ? : .scale(( )maxLength / length);
}
Vector3i {
.hash = ;
;
}
Vector3i {
( .x, .y, .z);
}
Vector3d {
(( ) .x, ( ) .y, ( ) .z);
}
Vector3f {
(( ) .x, ( ) .y, ( ) .z);
}
Vector3l {
(( ) .x, ( ) .y, ( ) .z);
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(Vector3i)o;
vector3i.x == .x && vector3i.y == .y && vector3i.z == .z;
} {
;
}
}
{
( .hash == ) {
.hash = ( )HashUtil.hash(( ) .x, ( ) .y, ( ) .z);
}
.hash;
}
String {
+ .x + + .y + + .z + ;
}
Vector3i {
(Math.max(a.x, b.x), Math.max(a.y, b.y), Math.max(a.z, b.z));
}
Vector3i {
(Math.min(a.x, b.x), Math.min(a.y, b.y), Math.min(a.z, b.z));
}
Vector3i {
to.clone().subtract(from).normalize();
}
Vector3i {
( ()).add(one).add(two);
}
Vector3i {
( ()).add(one).add(two).add(three);
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(Vector3i.class, Vector3i:: ).metadata(UIDisplayMode.COMPACT)).appendInherited( ( , Codec.INTEGER), (o, i) -> o.x = i, (o) -> o.x, (o, p) -> o.x = p.x).addValidator(Validators.nonNull()).add()).appendInherited( ( , Codec.INTEGER), (o, i) -> o.y = i, (o) -> o.y, (o, p) -> o.y = p.y).addValidator(Validators.nonNull()).add()).appendInherited( ( , Codec.INTEGER), (o, i) -> o.z = i, (o) -> o.z, (o, p) -> o.z = p.z).addValidator(Validators.nonNull()).add()).build();
ZERO = ( , , );
UP = ( , , );
POS_Y = UP;
DOWN = ( , - , );
NEG_Y = DOWN;
FORWARD = ( , , - );
NEG_Z = FORWARD;
NORTH = FORWARD;
BACKWARD = ( , , );
POS_Z = BACKWARD;
SOUTH = BACKWARD;
RIGHT = ( , , );
POS_X = RIGHT;
EAST = RIGHT;
LEFT = (- , , );
NEG_X = LEFT;
WEST = LEFT;
ALL_ONES = ( , , );
MIN = (- , - , - );
MAX = ( , , );
BLOCK_SIDES = []{UP, DOWN, FORWARD, BACKWARD, LEFT, RIGHT};
BLOCK_EDGES = []{add(UP, FORWARD), add(DOWN, FORWARD), add(UP, BACKWARD), add(DOWN, BACKWARD), add(UP, LEFT), add(DOWN, LEFT), add(UP, RIGHT), add(DOWN, RIGHT), add(FORWARD, LEFT), add(FORWARD, RIGHT), add(BACKWARD, LEFT), add(BACKWARD, RIGHT)};
BLOCK_CORNERS = []{add(UP, FORWARD, LEFT), add(UP, FORWARD, RIGHT), add(DOWN, FORWARD, LEFT), add(DOWN, FORWARD, RIGHT), add(UP, BACKWARD, LEFT), add(UP, BACKWARD, RIGHT), add(DOWN, BACKWARD, LEFT), add(DOWN, BACKWARD, RIGHT)};
BLOCK_PARTS = [][]{BLOCK_SIDES, BLOCK_EDGES, BLOCK_CORNERS};
CARDINAL_DIRECTIONS = []{NORTH, SOUTH, EAST, WEST};
}
}
com/hypixel/hytale/math/vector/Vector3l.java
package com.hypixel.hytale.math.vector;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.codec.schema.metadata.ui.UIDisplayMode;
import com.hypixel.hytale.codec.validation.Validators;
import com.hypixel.hytale.math.util.HashUtil;
import com.hypixel.hytale.math.util.MathUtil;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class Vector3l {
@Nonnull
public static final BuilderCodec<Vector3l> CODEC;
public static final Vector3l ZERO;
public static final Vector3l UP;
public static final Vector3l POS_Y;
public static final Vector3l DOWN;
public static final Vector3l NEG_Y;
public static final Vector3l FORWARD;
public static final Vector3l NEG_Z;
public static final Vector3l NORTH;
public static final Vector3l BACKWARD;
Vector3l POS_Z;
Vector3l SOUTH;
Vector3l RIGHT;
Vector3l POS_X;
Vector3l EAST;
Vector3l LEFT;
Vector3l NEG_X;
Vector3l WEST;
Vector3l ALL_ONES;
Vector3l MIN;
Vector3l MAX;
Vector3l[] BLOCK_SIDES;
Vector3l[] BLOCK_EDGES;
Vector3l[] BLOCK_CORNERS;
Vector3l[][] BLOCK_PARTS;
Vector3l[] CARDINAL_DIRECTIONS;
x;
y;
z;
hash;
{
( , , );
}
{
(v.x, v.y, v.z);
}
{
.x = x;
.y = y;
.z = z;
.hash = ;
}
{
.x;
}
{
.x = x;
.hash = ;
}
{
.y;
}
{
.y = y;
.hash = ;
}
{
.z;
}
{
.z = z;
.hash = ;
}
Vector3l {
.x = v.x;
.y = v.y;
.z = v.z;
.hash = v.hash;
;
}
Vector3l {
.x = v;
.y = v;
.z = v;
.hash = ;
;
}
Vector3l {
.x = v[ ];
.y = v[ ];
.z = v[ ];
.hash = ;
;
}
Vector3l {
.x = x;
.y = y;
.z = z;
.hash = ;
;
}
Vector3l {
.x += v.x;
.y += v.y;
.z += v.z;
.hash = ;
;
}
Vector3l {
.x += x;
.y += y;
.z += z;
.hash = ;
;
}
Vector3l {
.x += v.x * s;
.y += v.y * s;
.z += v.z * s;
.hash = ;
;
}
Vector3l {
.x -= v.x;
.y -= v.y;
.z -= v.z;
.hash = ;
;
}
Vector3l {
.x -= x;
.y -= y;
.z -= z;
.hash = ;
;
}
Vector3l {
.x = - .x;
.y = - .y;
.z = - .z;
.hash = ;
;
}
Vector3l {
.x *= s;
.y *= s;
.z *= s;
.hash = ;
;
}
Vector3l {
.x = ( )(( ) .x * s);
.y = ( )(( ) .y * s);
.z = ( )(( ) .z * s);
.hash = ;
;
}
Vector3l {
.x *= p.x;
.y *= p.y;
.z *= p.z;
.hash = ;
;
}
Vector3l {
.y * v.z - .z * v.y;
.z * v.x - .x * v.z;
.x * v.y - .y * v.x;
(x0, y0, z0);
}
Vector3l {
res.assign( .y * v.z - .z * v.y, .z * v.x - .x * v.z, .x * v.y - .y * v.x);
;
}
{
.x * other.x + .y * other.y + .z * other.z;
}
{
Math.sqrt(( ) .distanceSquaredTo(v));
}
{
Math.sqrt(( ) .distanceSquaredTo(x, y, z));
}
{
v.x - .x;
v.y - .y;
v.z - .z;
x0 * x0 + y0 * y0 + z0 * z0;
}
{
x - .x;
y - .y;
z - .z;
dx * dx + dy * dy + dz * dz;
}
Vector3l {
.setLength( );
}
{
Math.sqrt(( ) .squaredLength());
}
{
.x * .x + .y * .y + .z * .z;
}
Vector3l {
.scale(( )newLen / .length());
}
Vector3l {
.length();
( )maxLength > length ? : .scale(( )maxLength / length);
}
Vector3l {
.hash = ;
;
}
Vector3l {
( .x, .y, .z);
}
Vector3i {
(MathUtil.floor(( ) .x), MathUtil.floor(( ) .y), MathUtil.floor(( ) .z));
}
Vector3d {
(( ) .x, ( ) .y, ( ) .z);
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(Vector3l)o;
vector3l.x == .x && vector3l.y == .y && vector3l.z == .z;
} {
;
}
}
{
( .hash == ) {
.hash = ( )HashUtil.hash( .x, .y, .z);
}
.hash;
}
String {
+ .x + + .y + + .z + ;
}
Vector3l {
(Math.max(a.x, b.x), Math.max(a.y, b.y), Math.max(a.z, b.z));
}
Vector3l {
(Math.min(a.x, b.x), Math.min(a.y, b.y), Math.min(a.z, b.z));
}
Vector3l {
to.clone().subtract(from).normalize();
}
Vector3l {
( ()).add(one).add(two);
}
Vector3l {
( ()).add(one).add(two).add(three);
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(Vector3l.class, Vector3l:: ).metadata(UIDisplayMode.COMPACT)).appendInherited( ( , Codec.LONG), (o, i) -> o.x = i, (o) -> o.x, (o, p) -> o.x = p.x).addValidator(Validators.nonNull()).add()).appendInherited( ( , Codec.LONG), (o, i) -> o.y = i, (o) -> o.y, (o, p) -> o.y = p.y).addValidator(Validators.nonNull()).add()).appendInherited( ( , Codec.LONG), (o, i) -> o.z = i, (o) -> o.z, (o, p) -> o.z = p.z).addValidator(Validators.nonNull()).add()).build();
ZERO = ( , , );
UP = ( , , );
POS_Y = UP;
DOWN = ( , - , );
NEG_Y = DOWN;
FORWARD = ( , , - );
NEG_Z = FORWARD;
NORTH = FORWARD;
BACKWARD = ( , , );
POS_Z = BACKWARD;
SOUTH = BACKWARD;
RIGHT = ( , , );
POS_X = RIGHT;
EAST = RIGHT;
LEFT = (- , , );
NEG_X = LEFT;
WEST = LEFT;
ALL_ONES = ( , , );
MIN = (- , - , - );
MAX = ( , , );
BLOCK_SIDES = []{UP, DOWN, FORWARD, BACKWARD, LEFT, RIGHT};
BLOCK_EDGES = []{add(UP, FORWARD), add(DOWN, FORWARD), add(UP, BACKWARD), add(DOWN, BACKWARD), add(UP, LEFT), add(DOWN, LEFT), add(UP, RIGHT), add(DOWN, RIGHT), add(FORWARD, LEFT), add(FORWARD, RIGHT), add(BACKWARD, LEFT), add(BACKWARD, RIGHT)};
BLOCK_CORNERS = []{add(UP, FORWARD, LEFT), add(UP, FORWARD, RIGHT), add(DOWN, FORWARD, LEFT), add(DOWN, FORWARD, RIGHT), add(UP, BACKWARD, LEFT), add(UP, BACKWARD, RIGHT), add(DOWN, BACKWARD, LEFT), add(DOWN, BACKWARD, RIGHT)};
BLOCK_PARTS = [][]{BLOCK_SIDES, BLOCK_EDGES, BLOCK_CORNERS};
CARDINAL_DIRECTIONS = []{NORTH, SOUTH, EAST, WEST};
}
}
com/hypixel/hytale/math/vector/Vector4d.java
package com.hypixel.hytale.math.vector;
import javax.annotation.Nonnull;
public class Vector4d {
public static final int COMPONENT_X = 0 ;
public static final int COMPONENT_Y = 1 ;
public static final int COMPONENT_Z = 2 ;
public static final int COMPONENT_W = 3 ;
public double x;
public double y;
public double z;
public double w;
public Vector4d () {
this (0.0 , 0.0 , 0.0 , 0.0 );
}
public Vector4d (double x, double y, z, w) {
.x = x;
.y = y;
.z = z;
.w = w;
}
Vector4d {
(x, y, z, );
}
Vector4d {
(v.x, v.y, v.z, );
}
Vector4d {
(x, y, z, );
}
Vector4d {
.w = ;
;
}
Vector4d {
.w = ;
;
}
Vector4d {
.assign(v.x, v.y, v.z, v.w);
}
Vector4d {
.x = x;
.y = y;
.z = z;
.w = w;
;
}
Vector4d {
target.assign((dest.x - .x) * lerpFactor + .x, (dest.y - .y) * lerpFactor + .y, (dest.z - .z) * lerpFactor + .z, (dest.w - .w) * lerpFactor + .w);
target;
}
{
/ .w;
.x *= invW;
.y *= invW;
.z *= invW;
.w = ;
}
{
Math.abs( .x) <= Math.abs( .w) && Math.abs( .y) <= Math.abs( .w) && Math.abs( .z) <= Math.abs( .w);
}
{
var10000;
(component) {
-> var10000 = .x;
-> var10000 = .y;
-> var10000 = .z;
-> var10000 = .w;
-> ( + component);
}
var10000;
}
String {
+ .x + + .y + + .z + + .w + ;
}
}
com/hypixel/hytale/math/vector/VectorBoxUtil.java
package com.hypixel.hytale.math.vector;
import com.hypixel.fastutil.FastCollection;
import com.hypixel.hytale.function.consumer.IntBiObjectConsumer;
import com.hypixel.hytale.function.consumer.IntObjectConsumer;
import com.hypixel.hytale.function.consumer.IntTriObjectConsumer;
import com.hypixel.hytale.function.consumer.TriConsumer;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import javax.annotation.Nonnull;
public class VectorBoxUtil {
public VectorBoxUtil () {
}
public static void forEachVector (Iterable<Vector3d> vectors, double originX, double originY, double originZ, double apothem, Consumer<Vector3d> consumer) {
forEachVector(vectors, originX, originY, originZ, apothem, apothem, apothem, consumer);
}
public static void forEachVector (Iterable<Vector3d> vectors, double originX, double originY, double originZ, double apothemX, double apothemY, double apothemZ, Consumer<Vector3d> consumer) {
forEachVector(vectors, Function.identity(), originX, originY, originZ, apothemX, apothemY, apothemZ, consumer);
}
public static {
forEachVector(vectors, Function.identity(), originX, originY, originZ, apothemXMin, apothemYMin, apothemZMin, apothemXMax, apothemYMax, apothemZMax, consumer);
}
<T> {
forEachVector(input, func, originX, originY, originZ, apothem, apothem, apothem, consumer);
}
<T> {
forEachVector(input, func, originX, originY, originZ, -apothemX, -apothemY, -apothemZ, apothemX, apothemY, apothemZ, consumer);
}
<T> {
forEachVector(input, func, originX, originY, originZ, apothemXMin, apothemYMin, apothemZMin, apothemXMax, apothemYMax, apothemZMax, (TriConsumer)((t, c, n0) -> c.accept(t)), consumer, (Object) );
}
<T, V> {
forEachVector(input, func, originX, originY, originZ, apothem, apothem, apothem, consumer, objV);
}
<T, V> {
forEachVector(input, func, originX, originY, originZ, -apothemX, -apothemY, -apothemZ, apothemX, apothemY, apothemZ, consumer, objV);
}
<T, V> {
forEachVector(input, func, originX, originY, originZ, apothemXMin, apothemYMin, apothemZMin, apothemXMax, apothemYMax, apothemZMax, (TriConsumer)((t, objV1, c) -> c.accept(t, objV1)), objV, consumer);
}
<T, V1, V2> {
forEachVector(input, func, originX, originY, originZ, apothem, apothem, apothem, consumer, objV1, objV2);
}
<T, V1, V2> {
forEachVector(input, func, originX, originY, originZ, -apothemX, -apothemY, -apothemZ, apothemX, apothemY, apothemZ, consumer, objV1, objV2);
}
<T, V1, V2> {
(input FastCollection) {
((FastCollection)input).forEach((objx, _func, _originX, _originY, _originZ, _apothemXMin, _apothemYMin, _apothemZMin, _apothemXMax, _apothemYMax, _apothemZMax, _consumer, _objV1, _objV2) -> {
(Vector3d)_func.apply(objx);
(isInside(_originX, _originY, _originZ, _apothemXMin, _apothemYMin, _apothemZMin, _apothemXMax, _apothemYMax, _apothemZMax, vector)) {
_consumer.accept(objx, _objV1, _objV2);
}
}, func, originX, originY, originZ, apothemXMin, apothemYMin, apothemZMin, apothemXMax, apothemYMax, apothemZMax, consumer, objV1, objV2);
} {
(T obj : input) {
(Vector3d)func.apply(obj);
(isInside(originX, originY, originZ, apothemXMin, apothemYMin, apothemZMin, apothemXMax, apothemYMax, apothemZMax, vector)) {
consumer.accept(obj, objV1, objV2);
}
}
}
}
<T> {
forEachVector(input, func, originX, originY, originZ, apothem, apothem, apothem, consumer);
}
<T> {
forEachVector(input, func, originX, originY, originZ, -apothemX, -apothemY, -apothemZ, apothemX, apothemY, apothemZ, consumer);
}
<T> {
forEachVector(input, func, originX, originY, originZ, apothemXMin, apothemYMin, apothemZMin, apothemXMax, apothemYMax, apothemZMax, (IntTriObjectConsumer)((i, t, c, n0) -> c.accept(i, t)), consumer, (Object) );
}
<T, V> {
forEachVector(input, func, originX, originY, originZ, apothem, apothem, apothem, consumer, objV);
}
<T, V> {
forEachVector(input, func, originX, originY, originZ, -apothemX, -apothemY, -apothemZ, apothemX, apothemY, apothemZ, consumer, objV);
}
<T, V> {
forEachVector(input, func, originX, originY, originZ, apothemXMin, apothemYMin, apothemZMin, apothemXMax, apothemYMax, apothemZMax, (IntTriObjectConsumer)((i, t, objV1, c) -> c.accept(i, t, objV1)), objV, consumer);
}
<T, V1, V2> {
forEachVector(input, func, originX, originY, originZ, apothem, apothem, apothem, consumer, objV1, objV2);
}
<T, V1, V2> {
forEachVector(input, func, originX, originY, originZ, -apothemX, -apothemY, -apothemZ, apothemX, apothemY, apothemZ, consumer, objV1, objV2);
}
<T, V1, V2> {
(Int2ObjectMap.Entry<T> next : input.int2ObjectEntrySet()) {
next.getIntKey();
(T)next.getValue();
(Vector3d)func.apply(value);
(isInside(originX, originY, originZ, apothemXMin, apothemYMin, apothemZMin, apothemXMax, apothemYMax, apothemZMax, vector)) {
consumer.accept(key, value, objV1, objV2);
}
}
}
{
isInside(originX, originY, originZ, apothem, apothem, apothem, vector);
}
{
isInside(originX, originY, originZ, -apothemX, -apothemY, -apothemZ, apothemX, apothemY, apothemZ, vector);
}
{
vector.getX() - originX;
vector.getY() - originY;
vector.getZ() - originZ;
x >= xMin && x <= xMax && y >= yMin && y <= yMax && z >= zMin && z <= zMax;
}
}
com/hypixel/hytale/math/vector/VectorSphereUtil.java
package com.hypixel.hytale.math.vector;
import com.hypixel.fastutil.FastCollection;
import com.hypixel.hytale.function.consumer.IntBiObjectConsumer;
import com.hypixel.hytale.function.consumer.IntObjectConsumer;
import com.hypixel.hytale.function.consumer.IntTriObjectConsumer;
import com.hypixel.hytale.function.consumer.TriConsumer;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import javax.annotation.Nonnull;
public class VectorSphereUtil {
public VectorSphereUtil () {
}
public static void forEachVector (Iterable<Vector3d> vectors, double originX, double originY, double originZ, double radius, Consumer<Vector3d> consumer) {
forEachVector(vectors, originX, originY, originZ, radius, radius, radius, consumer);
}
public static void forEachVector (Iterable<Vector3d> vectors, double originX, double originY, double originZ, double radiusX, double radiusY, double radiusZ, Consumer<Vector3d> consumer) {
forEachVector(vectors, Function.identity(), originX, originY, originZ, radiusX, radiusY, radiusZ, consumer);
}
public static <T> {
forEachVector(input, func, originX, originY, originZ, radius, radius, radius, consumer);
}
<T> {
forEachVector(input, func, originX, originY, originZ, radiusX, radiusY, radiusZ, (TriConsumer)((t, c, n0) -> c.accept(t)), consumer, (Object) );
}
<T, V> {
forEachVector(input, func, originX, originY, originZ, radius, radius, radius, consumer, objV);
}
<T, V> {
forEachVector(input, func, originX, originY, originZ, radiusX, radiusY, radiusZ, (TriConsumer)((t, c, objV2) -> c.accept(t, objV2)), consumer, objV);
}
<T, V1, V2> {
forEachVector(input, func, originX, originY, originZ, radius, radius, radius, consumer, objV1, objV2);
}
<T, V1, V2> {
(input FastCollection<T> fastCollection) {
fastCollection.forEach((objx, _func, _originX, _originY, _originZ, _radiusX, _radiusY, _radiusZ, _consumer, _objV1, _objV2) -> {
(Vector3d)_func.apply(objx);
(isInside(_originX, _originY, _originZ, _radiusX, _radiusY, _radiusZ, vector)) {
_consumer.accept(objx, _objV1, _objV2);
}
}, func, originX, originY, originZ, radiusX, radiusY, radiusZ, consumer, objV1, objV2);
} {
(T obj : input) {
(Vector3d)func.apply(obj);
(isInside(originX, originY, originZ, radiusX, radiusY, radiusZ, vector)) {
consumer.accept(obj, objV1, objV2);
}
}
}
}
<T> {
forEachVector(input, func, originX, originY, originZ, radius, radius, radius, consumer);
}
<T> {
forEachVector(input, func, originX, originY, originZ, radiusX, radiusY, radiusZ, (IntTriObjectConsumer)((i, t, c, n0) -> c.accept(i, t)), consumer, (Object) );
}
<T, V> {
forEachVector(input, func, originX, originY, originZ, radius, radius, radius, consumer, objV);
}
<T, V> {
forEachVector(input, func, originX, originY, originZ, radiusX, radiusY, radiusZ, (IntTriObjectConsumer)((i, t, objV1, c) -> c.accept(i, t, objV1)), objV, consumer);
}
<T, V1, V2> {
forEachVector(input, func, originX, originY, originZ, radius, radius, radius, consumer, objV1, objV2);
}
<T, V1, V2> {
(Int2ObjectMap.Entry<T> next : input.int2ObjectEntrySet()) {
next.getIntKey();
(T)next.getValue();
(Vector3d)func.apply(value);
(isInside(originX, originY, originZ, radiusX, radiusY, radiusZ, vector)) {
consumer.accept(key, value, objV1, objV2);
}
}
}
{
isInside(originX, originY, originZ, radius, radius, radius, vector);
}
{
vector.getX() - originX;
vector.getY() - originY;
vector.getZ() - originZ;
x / radiusX;
y / radiusY;
z / radiusZ;
xRatio * xRatio + yRatio * yRatio + zRatio * zRatio <= ;
}
}
com/hypixel/hytale/math/vector/relative/RelativeVector2d.java
package com.hypixel.hytale.math.vector.relative;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.codec.validation.Validators;
import com.hypixel.hytale.math.vector.Vector2d;
import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class RelativeVector2d {
@Nonnull
public static final BuilderCodec<RelativeVector2d> CODEC;
private Vector2d vector;
private boolean relative;
public RelativeVector2d (@Nonnull Vector2d vector, boolean relative) {
this .vector = vector;
this .relative = relative;
}
protected RelativeVector2d () {
}
@Nonnull
public Vector2d getVector () {
return this .vector;
}
public boolean isRelative () {
return this .relative;
}
@Nonnull
public Vector2d resolve {
.relative ? vector.clone().add(vector) : vector.clone();
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(RelativeVector2d)o;
.relative != that.relative ? : Objects.equals( .vector, that.vector);
} {
;
}
}
{
.vector != ? .vector.hashCode() : ;
result = * result + ( .relative ? : );
result;
}
String {
String.valueOf( .vector);
+ var10000 + + .relative + ;
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(RelativeVector2d.class, RelativeVector2d:: ).append( ( , Vector2d.CODEC), (o, i) -> o.vector = i, RelativeVector2d::getVector).addValidator(Validators.nonNull()).add()).append( ( , Codec.BOOLEAN), (o, i) -> o.relative = i, RelativeVector2d::isRelative).addValidator(Validators.nonNull()).add()).build();
}
}
com/hypixel/hytale/math/vector/relative/RelativeVector2i.java
package com.hypixel.hytale.math.vector.relative;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.codec.validation.Validators;
import com.hypixel.hytale.math.vector.Vector2i;
import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class RelativeVector2i {
@Nonnull
public static final BuilderCodec<RelativeVector2i> CODEC;
private Vector2i vector;
private boolean relative;
public RelativeVector2i (@Nonnull Vector2i vector, boolean relative) {
this .vector = vector;
this .relative = relative;
}
protected RelativeVector2i () {
}
@Nonnull
public Vector2i getVector () {
return this .vector;
}
public boolean isRelative () {
return this .relative;
}
@Nonnull
public Vector2i resolve {
.relative ? vector.clone().add(vector) : vector.clone();
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(RelativeVector2i)o;
.relative != that.relative ? : Objects.equals( .vector, that.vector);
} {
;
}
}
{
.vector != ? .vector.hashCode() : ;
result = * result + ( .relative ? : );
result;
}
String {
String.valueOf( .vector);
+ var10000 + + .relative + ;
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(RelativeVector2i.class, RelativeVector2i:: ).append( ( , Vector2i.CODEC), (o, i) -> o.vector = i, RelativeVector2i::getVector).addValidator(Validators.nonNull()).add()).append( ( , Codec.BOOLEAN), (o, i) -> o.relative = i, RelativeVector2i::isRelative).addValidator(Validators.nonNull()).add()).build();
}
}
com/hypixel/hytale/math/vector/relative/RelativeVector2l.java
package com.hypixel.hytale.math.vector.relative;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.codec.validation.Validators;
import com.hypixel.hytale.math.vector.Vector2l;
import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class RelativeVector2l {
@Nonnull
public static final BuilderCodec<RelativeVector2l> CODEC;
private Vector2l vector;
private boolean relative;
public RelativeVector2l (@Nonnull Vector2l vector, boolean relative) {
this .vector = vector;
this .relative = relative;
}
protected RelativeVector2l () {
}
@Nonnull
public Vector2l getVector () {
return this .vector;
}
public boolean isRelative () {
return this .relative;
}
@Nonnull
public Vector2l resolve {
.relative ? vector.clone().add(vector) : vector.clone();
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(RelativeVector2l)o;
.relative != that.relative ? : Objects.equals( .vector, that.vector);
} {
;
}
}
{
.vector != ? .vector.hashCode() : ;
result = * result + ( .relative ? : );
result;
}
String {
String.valueOf( .vector);
+ var10000 + + .relative + ;
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(RelativeVector2l.class, RelativeVector2l:: ).append( ( , Vector2l.CODEC), (o, i) -> o.vector = i, RelativeVector2l::getVector).addValidator(Validators.nonNull()).add()).append( ( , Codec.BOOLEAN), (o, i) -> o.relative = i, RelativeVector2l::isRelative).addValidator(Validators.nonNull()).add()).build();
}
}
com/hypixel/hytale/math/vector/relative/RelativeVector3d.java
package com.hypixel.hytale.math.vector.relative;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.codec.validation.Validators;
import com.hypixel.hytale.math.vector.Vector3d;
import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class RelativeVector3d {
@Nonnull
public static final BuilderCodec<RelativeVector3d> CODEC;
private Vector3d vector;
private boolean relative;
public RelativeVector3d (@Nonnull Vector3d vector, boolean relative) {
this .vector = vector;
this .relative = relative;
}
protected RelativeVector3d () {
}
@Nonnull
public Vector3d getVector () {
return this .vector;
}
public boolean isRelative () {
return this .relative;
}
@Nonnull
public Vector3d resolve {
.relative ? vector.clone().add(vector) : vector.clone();
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(RelativeVector3d)o;
.relative != that.relative ? : Objects.equals( .vector, that.vector);
} {
;
}
}
{
.vector != ? .vector.hashCode() : ;
result = * result + ( .relative ? : );
result;
}
String {
String.valueOf( .vector);
+ var10000 + + .relative + ;
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(RelativeVector3d.class, RelativeVector3d:: ).append( ( , Vector3d.CODEC), (o, i) -> o.vector = i, RelativeVector3d::getVector).addValidator(Validators.nonNull()).add()).append( ( , Codec.BOOLEAN), (o, i) -> o.relative = i, RelativeVector3d::isRelative).addValidator(Validators.nonNull()).add()).build();
}
}
com/hypixel/hytale/math/vector/relative/RelativeVector3i.java
package com.hypixel.hytale.math.vector.relative;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.codec.validation.Validators;
import com.hypixel.hytale.math.vector.Vector3i;
import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class RelativeVector3i {
@Nonnull
public static final BuilderCodec<RelativeVector3i> CODEC;
private Vector3i vector;
private boolean relative;
public RelativeVector3i (@Nonnull Vector3i vector, boolean relative) {
this .vector = vector;
this .relative = relative;
}
protected RelativeVector3i () {
}
@Nonnull
public Vector3i getVector () {
return this .vector;
}
public boolean isRelative () {
return this .relative;
}
@Nonnull
public Vector3i resolve {
.relative ? vector.clone().add(vector) : vector.clone();
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(RelativeVector3i)o;
.relative != that.relative ? : Objects.equals( .vector, that.vector);
} {
;
}
}
{
.vector != ? .vector.hashCode() : ;
result = * result + ( .relative ? : );
result;
}
String {
String.valueOf( .vector);
+ var10000 + + .relative + ;
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(RelativeVector3i.class, RelativeVector3i:: ).append( ( , Vector3i.CODEC), (o, i) -> o.vector = i, RelativeVector3i::getVector).addValidator(Validators.nonNull()).add()).append( ( , Codec.BOOLEAN), (o, i) -> o.relative = i, RelativeVector3i::isRelative).addValidator(Validators.nonNull()).add()).build();
}
}
com/hypixel/hytale/math/vector/relative/RelativeVector3l.java
package com.hypixel.hytale.math.vector.relative;
import com.hypixel.hytale.codec.Codec;
import com.hypixel.hytale.codec.KeyedCodec;
import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.codec.validation.Validators;
import com.hypixel.hytale.math.vector.Vector3l;
import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class RelativeVector3l {
@Nonnull
public static final BuilderCodec<RelativeVector3l> CODEC;
private Vector3l vector;
private boolean relative;
public RelativeVector3l (@Nonnull Vector3l vector, boolean relative) {
this .vector = vector;
this .relative = relative;
}
protected RelativeVector3l () {
}
@Nonnull
public Vector3l getVector () {
return this .vector;
}
public boolean isRelative () {
return this .relative;
}
@Nonnull
public Vector3l resolve {
.relative ? vector.clone().add(vector) : vector.clone();
}
{
( == o) {
;
} (o != && .getClass() == o.getClass()) {
(RelativeVector3l)o;
.relative != that.relative ? : Objects.equals( .vector, that.vector);
} {
;
}
}
{
.vector != ? .vector.hashCode() : ;
result = * result + ( .relative ? : );
result;
}
String {
String.valueOf( .vector);
+ var10000 + + .relative + ;
}
{
CODEC = ((BuilderCodec.Builder)((BuilderCodec.Builder)BuilderCodec.builder(RelativeVector3l.class, RelativeVector3l:: ).append( ( , Vector3l.CODEC), (o, i) -> o.vector = i, RelativeVector3l::getVector).addValidator(Validators.nonNull()).add()).append( ( , Codec.BOOLEAN), (o, i) -> o.relative = i, RelativeVector3l::isRelative).addValidator(Validators.nonNull()).add()).build();
}
}