From 7c71fdfb64dad217a99a190ad65a3cecf132b863 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 4 Dec 2023 03:18:24 +0100 Subject: less unnecessary stuff --- .../hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt index 520f1283c..b07c4dab6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt @@ -70,16 +70,16 @@ object TrevorFeatures { init { fixedRateTimer(name = "skyhanni-update-trapper", period = 1000L) { - Minecraft.getMinecraft().addScheduledTask { - try { - if (config.trapperSolver && onFarmingIsland()) { + if (onFarmingIsland() && config.trapperSolver) { + Minecraft.getMinecraft().addScheduledTask { + try { updateTrapper() TrevorTracker.update() TrevorTracker.calculatePeltsPerHour() if (questActive) TrevorSolver.findMob() + } catch (error: Throwable) { + ErrorManager.logError(error, "Encountered an error when updating the trapper solver") } - } catch (error: Throwable) { - ErrorManager.logError(error, "Encountered an error when updating the trapper solver") } } } @@ -161,7 +161,6 @@ object TrevorFeatures { ) } - private fun updateTrapper() { timeUntilNextReady -= 1 if (trapperReady && timeUntilNextReady > 0) { -- cgit