diff options
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt | 27 |
1 files changed, 11 insertions, 16 deletions
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) |