diff options
author | msg-programs <msgdoesstuff@gmail.com> | 2023-09-08 09:54:47 +0200 |
---|---|---|
committer | msg-programs <msgdoesstuff@gmail.com> | 2023-09-08 09:54:47 +0200 |
commit | 7df2a590d4b0079f65ef639315d04f63c2f754a7 (patch) | |
tree | fb2b0594a7e0b397b8f5afccdfa8ae7409edb9f8 /src/main/java/me/xmrvizzy/skyblocker/utils/Boxes.java | |
parent | b153e75818b5058df9334953d5924c2c82598719 (diff) | |
parent | 9c7bf54123f366ad90bfafe81e973b731fd6b5b3 (diff) | |
download | Skyblocker-7df2a590d4b0079f65ef639315d04f63c2f754a7.tar.gz Skyblocker-7df2a590d4b0079f65ef639315d04f63c2f754a7.tar.bz2 Skyblocker-7df2a590d4b0079f65ef639315d04f63c2f754a7.zip |
Merge branch 'master' of https://github.com/SkyblockerMod/Skyblocker into readme-fixes
Pull upstream updates into branch
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()); |