aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java
diff options
context:
space:
mode:
authorKevin <92656833+kevinthegreat1@users.noreply.github.com>2023-09-05 19:45:14 -0400
committerGitHub <noreply@github.com>2023-09-05 19:45:14 -0400
commitedf217cd8d3f2344700ae44416031ae3d695bf77 (patch)
treea5f6269f3567fe28a410b8fd93c89801ba0c14c6 /src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java
parentd6d50160c9a1e5145119d4b06bcd74e9c662238e (diff)
parent30a7b733b0c5a0e7b5002dfd68ec6ece04c02ecc (diff)
downloadSkyblocker-edf217cd8d3f2344700ae44416031ae3d695bf77.tar.gz
Skyblocker-edf217cd8d3f2344700ae44416031ae3d695bf77.tar.bz2
Skyblocker-edf217cd8d3f2344700ae44416031ae3d695bf77.zip
Merge pull request #274 from kevinthegreat1/utils-cleanup
Utils cleanup
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java')
-rw-r--r--src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java b/src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java
index 445bcbe5..17874c9c 100644
--- a/src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java
+++ b/src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java
@@ -1,12 +1,10 @@
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);
@@ -17,6 +15,11 @@ public class Boxes {
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.getXLength(), box.getYLength(), box.getZLength());
+ }
+
/** Offsets this box so that minX, minY and minZ are all zero. **/
public static Box moveToZero(Box box) {
return box.offset(getMinVec(box).negate());