From 1c1c69f088036eb2e9f265c7e0c7fbcfb5d123b8 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 9 Dec 2023 12:47:14 +0100 Subject: Fixed error messages in composter inventory when hovering over some items. --- .../garden/composter/GardenComposterInventoryFeatures.kt | 13 +------------ .../features/garden/inventory/GardenNextPlotPrice.kt | 3 +-- 2 files changed, 2 insertions(+), 14 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden') diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt index 75e62468f..e57789884 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt @@ -4,7 +4,6 @@ import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.features.garden.GardenAPI -import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils import at.hannibal2.skyhanni.utils.ItemUtils.getLore @@ -34,18 +33,8 @@ class GardenComposterInventoryFeatures { var indexFullCost = 0 var fullPrice = 0.0 var amountItems = 0 - for (originalLine in list) { + for (line in event.toolTipRemovedPrefix()) { i++ - val line = try { - originalLine.substring(4) - } catch (e: Throwable) { - ErrorManager.logErrorWithData( - e, "Error reading composter data.", - "originalLine" to originalLine, - "list" to list, - ) - return - } if (line == "ยง7Upgrade Cost:") { next = true indexFullCost = i diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenNextPlotPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenNextPlotPrice.kt index 9a4deaf2f..037031360 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenNextPlotPrice.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenNextPlotPrice.kt @@ -25,9 +25,8 @@ class GardenNextPlotPrice { var next = false val list = event.toolTip var i = -1 - for (l in list) { + for (line in event.toolTipRemovedPrefix()) { i++ - val line = l.substring(4) if (line.contains("Cost")) { next = true continue -- cgit