diff options
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java')
-rw-r--r-- | src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java | 7 |
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()); |