From 9a2286ac3070e1ba0023445dc8243e618989e86e Mon Sep 17 00:00:00 2001 From: Empa <42304516+ItsEmpa@users.noreply.github.com> Date: Fri, 11 Oct 2024 19:01:42 +0200 Subject: Backend: LorenzVec up/down and drawLineToEye (#2056) Co-authored-by: ItsEmpa Co-authored-by: Cal Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt index 34aa3f22f..d2394624c 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LocationUtils.kt @@ -35,7 +35,7 @@ object LocationUtils { fun playerEyeLocation(): LorenzVec { val player = Minecraft.getMinecraft().thePlayer val vec = player.getLorenzVec() - return vec.add(y = player.getEyeHeight().toDouble()) + return vec.up(player.getEyeHeight().toDouble()) } fun AxisAlignedBB.isInside(vec: LorenzVec) = isVecInside(vec.toVec3()) @@ -53,7 +53,7 @@ object LocationUtils { fun LorenzVec.canBeSeen(yOffsetRange: IntRange, radius: Double = 150.0): Boolean = yOffsetRange.any { offset -> - this.add(y = offset).canBeSeen(radius) + up(offset).canBeSeen(radius) } fun AxisAlignedBB.minBox() = LorenzVec(minX, minY, minZ) @@ -99,7 +99,7 @@ object LocationUtils { fun AxisAlignedBB.getCenter() = getEdgeLengths() * 0.5 + minBox() - fun AxisAlignedBB.getTopCenter() = getCenter().add(y = (maxY - minY) / 2) + fun AxisAlignedBB.getTopCenter() = getCenter().up((maxY - minY) / 2) fun AxisAlignedBB.clampTo(other: AxisAlignedBB): AxisAlignedBB { val minX = max(this.minX, other.minX) -- cgit