aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-02-19 00:53:55 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-02-19 00:53:55 +0100
commit58be34abd12742248986a118bc2d784b12ae4fd2 (patch)
treeca7ef457bd361d553f0f56d8a27b36267eebc0d3 /src/main/java/at/hannibal2
parentf643b5722416b29fdb7ab8777c9046fa08c581fb (diff)
downloadskyhanni-58be34abd12742248986a118bc2d784b12ae4fd2.tar.gz
skyhanni-58be34abd12742248986a118bc2d784b12ae4fd2.tar.bz2
skyhanni-58be34abd12742248986a118bc2d784b12ae4fd2.zip
removed hidden catch (bazaar has no errors anymore, promise)
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt27
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)