diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-04 14:33:39 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-04 14:33:39 +0200 |
commit | 0a29213e7b22dd3673138a7283a8ac97fc133aed (patch) | |
tree | 70b7ffdb6d069cfb160b6e3c505215fb31dafe66 /src/main/java/at/hannibal2/skyhanni/utils | |
parent | f9b645ec52f44548ec8197190373ccae4335bae2 (diff) | |
download | skyhanni-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.kt | 5 |
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 |