From 30b3c5bfd4100c34eaea5b7dd15efc841a328d29 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 28 Aug 2023 14:11:44 +0200 Subject: fixed float and double rounding errors --- .../java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt | 4 ++-- .../features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt index f569a0f21..ee80ab77b 100755 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt @@ -38,8 +38,8 @@ class GardenYawAndPitch { if (!config.showAlways && System.currentTimeMillis() > lastChange + (config.timeout * 1000)) return val displayList = listOf( - "§aYaw: §f${yaw.toDouble().round(config.yawPrecision)}", - "§aPitch: §f${pitch.toDouble().round(config.pitchPrecision)}", + "§aYaw: §f${yaw.round(config.yawPrecision)}", + "§aPitch: §f${pitch.round(config.pitchPrecision)}", ) if (GardenAPI.inGarden()) { config.pos.renderStrings(displayList, posLabel = "Yaw and Pitch") diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt index c4e0cbb26..f09e86164 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt @@ -139,7 +139,7 @@ class ItemAbilityCooldown { } } if (event.soundName == "random.drink") { - if (event.pitch.round(1) == 1.8 && event.volume == 1.0f) { + if (event.pitch.round(1) == 1.8f && event.volume == 1.0f) { ItemAbility.HOLY_ICE.sound() } } -- cgit