diff options
author | Appability <appable@icloud.com> | 2022-10-20 21:44:04 -0700 |
---|---|---|
committer | Appability <appable@icloud.com> | 2022-10-20 21:44:04 -0700 |
commit | 1c3359e42f38012dae182e75200cc1f364dcda8f (patch) | |
tree | 73d79fd8fde240bd9ebe4eb734c1d536baa91650 /src/main/kotlin | |
parent | 1b6bd76b7e5c2f462bf55f0753ef459b445dcfb6 (diff) | |
download | AmbientAddons-1c3359e42f38012dae182e75200cc1f364dcda8f.tar.gz AmbientAddons-1c3359e42f38012dae182e75200cc1f364dcda8f.tar.bz2 AmbientAddons-1c3359e42f38012dae182e75200cc1f364dcda8f.zip |
fix thunder detection + stop reimplementing euclidean distance (thanks ilmars <3)
Diffstat (limited to 'src/main/kotlin')
-rw-r--r-- | src/main/kotlin/com/ambientaddons/features/misc/CrimsonFishing.kt | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/main/kotlin/com/ambientaddons/features/misc/CrimsonFishing.kt b/src/main/kotlin/com/ambientaddons/features/misc/CrimsonFishing.kt index 6ed1d1b..33cb502 100644 --- a/src/main/kotlin/com/ambientaddons/features/misc/CrimsonFishing.kt +++ b/src/main/kotlin/com/ambientaddons/features/misc/CrimsonFishing.kt @@ -49,7 +49,7 @@ object CrimsonFishing { fun onRenderWorld(event: RenderWorldLastEvent) { if (SBLocation.area != Area.CrimsonIsle) return mc.theWorld.loadedEntityList.forEach { - if (it is EntityIronGolem || it is EntityGuardian) { + if (it is EntityIronGolem || (it is EntityGuardian && it.isElder)) { if (config.crimsonHighlight != 0) { EntityUtils.drawEntityBox( entity = it, @@ -61,19 +61,14 @@ object CrimsonFishing { ) } if (config.crimsonNotify && !knownEntities.contains(it)) { - val distance = sqrt((it.posX - mc.thePlayer.posX).pow(2) + - (it.posY - mc.thePlayer.posY).pow(2) + - (it.posZ - mc.thePlayer.posZ).pow(2) - ) + val distance = it.positionVector.distanceTo(mc.thePlayer.positionVector) if (it is EntityIronGolem) { - UChat.chat("\n§c§lA legendary creature has been spotted nearby... Lord Jawbus has arrived.") + UChat.chat("§c§lA legendary creature has been spotted §e§l${distance.roundToInt()} blocks §c§laway... Lord Jawbus has arrived.") mc.thePlayer.playSound("random.orb", 1f, 0.5f) } else { - UChat.chat("\n§c§lYou hear a massive rumble as a Thunder emerges nearby.") + UChat.chat("§c§lYou hear a massive rumble as a Thunder emerges §e§l${distance.roundToInt()} blocks §c§laway.") mc.thePlayer.playSound("random.orb", 1f, 0.5f) } - UChat.chat("§cSpotted §6§l${distance.roundToInt()} §cblocks away.\n") - } knownEntities.add(it) } else if (isSpark(it) && config.crimsonHighlight != 0) { |