From e43d1b9e5debae6fb9b75134f3e708e8baa83ea1 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 15 Apr 2023 20:37:56 +0200 Subject: Used distanceToPlayer --- src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt | 2 +- src/main/java/at/hannibal2/skyhanni/test/PacketTest.kt | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/test') diff --git a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt index b6d3873f7..917f33f1d 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt @@ -194,7 +194,7 @@ class LorenzTest { @SubscribeEvent fun onSoundPlay(event: PlaySoundEvent) { // val location = event.location -// val distance = location.distance(LocationUtils.playerLocation()) +// val distance = location.distanceToPlayer() // val soundName = event.soundName // val pitch = event.pitch // val volume = event.volume diff --git a/src/main/java/at/hannibal2/skyhanni/test/PacketTest.kt b/src/main/java/at/hannibal2/skyhanni/test/PacketTest.kt index 7adb36150..1203f2982 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/PacketTest.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/PacketTest.kt @@ -1,8 +1,12 @@ package at.hannibal2.skyhanni.test import at.hannibal2.skyhanni.events.PacketEvent -import at.hannibal2.skyhanni.utils.* +import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer +import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.round +import at.hannibal2.skyhanni.utils.LorenzVec +import at.hannibal2.skyhanni.utils.getLorenzVec +import at.hannibal2.skyhanni.utils.toLorenzVec import net.minecraft.client.Minecraft import net.minecraft.entity.Entity import net.minecraft.network.Packet @@ -127,7 +131,7 @@ class PacketTest { } private fun getDistance(location: LorenzVec?): Double { - return location?.distance(LocationUtils.playerLocation())?.round(1) ?: 0.0 + return location?.distanceToPlayer()?.round(1) ?: 0.0 } private fun getLocation(packet: Packet<*>, entity: Entity?): LorenzVec? { -- cgit