From d40f64e8a3bf305c016e9c16f73a93723b0254b2 Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Wed, 28 Jun 2023 08:27:36 +1000 Subject: Merge pull request #269 * fix --- .../at/hannibal2/skyhanni/features/rift/ShyCruxWarnings.kt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/ShyCruxWarnings.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/ShyCruxWarnings.kt index 0b7f60d30..a8b46741e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/ShyCruxWarnings.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/ShyCruxWarnings.kt @@ -3,7 +3,6 @@ package at.hannibal2.skyhanni.features.rift import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.TitleUtils import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.test.command.CopyErrorCommand import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer import net.minecraft.client.Minecraft import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -13,20 +12,16 @@ class ShyCruxWarnings { @SubscribeEvent fun onTick(event: LorenzTickEvent) { + if (!RiftAPI.inRift() || !SkyHanniMod.feature.rift.crux.shyWarning) return if (event.isMod(2)) { checkForShy() } } private fun checkForShy() { - try { - if (!(RiftAPI.inRift() || !SkyHanniMod.feature.rift.crux.shyWarning)) return - val list = Minecraft.getMinecraft().theWorld?.getLoadedEntityList() ?: return - if (list.any { it.name in shyNames && it.distanceToPlayer() < 8 }) { - TitleUtils.sendTitle("§eLook away!", 250) - } - } catch (e: Throwable) { - CopyErrorCommand.logError(e, "Check for Shy failed") + val list = Minecraft.getMinecraft().theWorld?.getLoadedEntityList() ?: return + if (list.any { it.name in shyNames && it.distanceToPlayer() < 8 }) { + TitleUtils.sendTitle("§eLook away!", 150) } } } \ No newline at end of file -- cgit