diff options
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt | 12 |
2 files changed, 4 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt index 0e31c45bb..ec8b61b5f 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt @@ -154,5 +154,5 @@ object EntityUtils { if (Minecraft.getMinecraft().isCallingFromMinecraftThread) it else it.toMutableList() }?.asSequence() ?: emptySequence() - fun Entity.canBeSeen(radius: Double = 150.0) = getLorenzVec().add(0.0, 0.5, 0.0).canBeSeen(radius) + fun Entity.canBeSeen(radius: Double = 150.0) = getLorenzVec().add(y = 0.5).canBeSeen(radius) } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt index d665fa3a0..bdab17b3b 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt @@ -48,17 +48,11 @@ data class LorenzVec( return (dx * dx + dz * dz) } - fun add(x: Double, y: Double, z: Double): LorenzVec = LorenzVec(this.x + x, this.y + y, this.z + z) + fun add(x: Double = 0.0, y: Double = 0.0, z: Double = 0.0): LorenzVec = LorenzVec(this.x + x, this.y + y, this.z + z) fun add(x: Int, y: Int, z: Int): LorenzVec = LorenzVec(this.x + x, this.y + y, this.z + z) - override fun toString(): String { - return "LorenzVec{" + - "x=" + x + - ", y=" + y + - ", z=" + z + - '}' - } + override fun toString() = "LorenzVec{x=$x, y=$y, z=$z}" fun multiply(d: Double): LorenzVec = LorenzVec(x multiplyZeroSave d, y multiplyZeroSave d, z multiplyZeroSave d) @@ -174,4 +168,4 @@ fun S2APacketParticles.toLorenzVec() = LorenzVec(xCoordinate, yCoordinate, zCoor fun Array<Double>.toLorenzVec(): LorenzVec { return LorenzVec(this[0], this[1], this[2]) -}
\ No newline at end of file +} |