aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java
diff options
context:
space:
mode:
authorAaron <51387595+AzureAaron@users.noreply.github.com>2023-10-09 23:07:23 -0400
committerGitHub <noreply@github.com>2023-10-09 23:07:23 -0400
commita373db64a319c263b2b4c1d07084fa18bd12353b (patch)
tree0f918dd1c05c42616797e47e165e2385f0fca65b /src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java
parent2315b90da8117f28f66348927afdb621ee4fc815 (diff)
parentf346617971b20f6be373411ce5433487cd8d82c2 (diff)
downloadSkyblocker-a373db64a319c263b2b4c1d07084fa18bd12353b.tar.gz
Skyblocker-a373db64a319c263b2b4c1d07084fa18bd12353b.tar.bz2
Skyblocker-a373db64a319c263b2b4c1d07084fa18bd12353b.zip
Merge pull request #348 from LifeIsAParadox/change-packageprefix
me.xrmvizzy -> de.hysky
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java')
-rw-r--r--src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java b/src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java
deleted file mode 100644
index 977d013c..00000000
--- a/src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package me.xmrvizzy.skyblocker.utils;
-
-import net.minecraft.util.math.Box;
-import net.minecraft.util.math.Direction.Axis;
-import net.minecraft.util.math.Vec3d;
-
-public class Boxes {
- /** Returns the vector of the min pos of this box. **/
- public static Vec3d getMinVec(Box box) {
- return new Vec3d(box.minX, box.minY, box.minZ);
- }
-
- /** Returns the vector of the max pos of this box. **/
- public static Vec3d getMaxVec(Box box) {
- return new Vec3d(box.maxX, box.maxY, box.maxZ);
- }
-
- /** Returns the vector of the side lengths of this box. **/
- public static Vec3d getLengthVec(Box box) {
- return new Vec3d(box.getLengthX(), box.getLengthY(), box.getLengthZ());
- }
-
- /** Offsets this box so that minX, minY and minZ are all zero. **/
- public static Box moveToZero(Box box) {
- return box.offset(getMinVec(box).negate());
- }
-
- /** Returns the distance between to oppisite corners of the box. **/
- public static double getCornerLength(Box box) {
- return getMinVec(box).distanceTo(getMaxVec(box));
- }
-
- /** Returns the length of an axis in the box. **/
- public static double getAxisLength(Box box, Axis axis) {
- return box.getMax(axis) - box.getMin(axis);
- }
-
- /** Returns a box with each axis multiplied by the amount specified. **/
- public static Box multiply(Box box, double amount) {
- return multiply(box, amount, amount, amount);
- }
-
- /** Returns a box with each axis multiplied by the amount specified. **/
- public static Box multiply(Box box, double x, double y, double z) {
- return box.expand(
- getAxisLength(box, Axis.X) * (x - 1) / 2d,
- getAxisLength(box, Axis.Y) * (y - 1) / 2d,
- getAxisLength(box, Axis.Z) * (z - 1) / 2d);
- }
-}