aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-04 14:33:39 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-04 14:33:39 +0200
commit0a29213e7b22dd3673138a7283a8ac97fc133aed (patch)
tree70b7ffdb6d069cfb160b6e3c505215fb31dafe66 /src/main/java/at/hannibal2/skyhanni/utils
parentf9b645ec52f44548ec8197190373ccae4335bae2 (diff)
downloadskyhanni-0a29213e7b22dd3673138a7283a8ac97fc133aed.tar.gz
skyhanni-0a29213e7b22dd3673138a7283a8ac97fc133aed.tar.bz2
skyhanni-0a29213e7b22dd3673138a7283a8ac97fc133aed.zip
isVecInside support for LorenzVec, and added isPlayerInside
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt
index 510f631b6..bf7a0f1ee 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt
@@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.utils
import net.minecraft.client.Minecraft
import net.minecraft.entity.Entity
+import net.minecraft.util.AxisAlignedBB
object LocationUtils {
@@ -20,4 +21,8 @@ object LocationUtils {
val vec = player.getLorenzVec()
return vec.add(0.0, 0.0 + player.getEyeHeight(), 0.0)
}
+
+ fun AxisAlignedBB.isVecInside(vec: LorenzVec) = isVecInside(vec.toVec3())
+
+ fun AxisAlignedBB.isPlayerInside() = isVecInside(playerLocation())
} \ No newline at end of file