From 58be34abd12742248986a118bc2d784b12ae4fd2 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 19 Feb 2024 00:53:55 +0100 Subject: removed hidden catch (bazaar has no errors anymore, promise) --- .../features/bazaar/BazaarBestSellMethod.kt | 27 +++++++++------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt index de37b8b9b..770c06ba9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt @@ -47,25 +47,20 @@ class BazaarBestSellMethod { if (internalName == null) { return "§cUnknown Bazaar item!" } - try { - var having = InventoryUtils.countItemsInLowerInventory { it.getInternalName() == internalName } - lastClickedItem?.let { - if (it.getInternalName() == internalName) { - having += it.stackSize - } + var having = InventoryUtils.countItemsInLowerInventory { it.getInternalName() == internalName } + lastClickedItem?.let { + if (it.getInternalName() == internalName) { + having += it.stackSize } - if (having <= 0) return "" + } + if (having <= 0) return "" - val data = internalName.getBazaarData() ?: return "" - val totalDiff = (data.buyPrice - data.sellPrice) * having - val result = NumberUtil.format(totalDiff.toInt()) + val data = internalName.getBazaarData() ?: return "" + val totalDiff = (data.buyPrice - data.sellPrice) * having + val result = NumberUtil.format(totalDiff.toInt()) - val name = internalName.getNameWithEnchantment() - return "$name§7 sell difference: §6$result coins" - } catch (e: Error) { - e.printStackTrace() - return "" - } + val name = internalName.getNameWithEnchantment() + return "$name§7 sell difference: §6$result coins" } @SubscribeEvent(priority = EventPriority.LOWEST) -- cgit