diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-07 22:44:59 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-07 22:44:59 +0100 |
commit | 48de5556d823f4bd0bf47f5e247c3a7d3f8c1a58 (patch) | |
tree | 505253fb8e5e28637f9e7c0e93c5888b1428921f /src/main/java/at/hannibal2 | |
parent | fc18fe2c36de492ca045fc701433e4bdc8054e6f (diff) | |
download | skyhanni-48de5556d823f4bd0bf47f5e247c3a7d3f8c1a58.tar.gz skyhanni-48de5556d823f4bd0bf47f5e247c3a7d3f8c1a58.tar.bz2 skyhanni-48de5556d823f4bd0bf47f5e247c3a7d3f8c1a58.zip |
Fixed bazaar helper display.
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt index fb4c3079b..7f0e86598 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt @@ -30,7 +30,7 @@ class BazaarOrderHelper { val inventoryName = chest.getInventoryName() if (!isBazaarOrderInventory(inventoryName)) return - out@ for (slot in chest.inventorySlots) { + for (slot in chest.inventorySlots) { if (slot == null) continue if (slot.slotNumber != slot.slotIndex) continue if (slot.stack == null) continue @@ -44,14 +44,18 @@ class BazaarOrderHelper { val rawName = itemName.split(if (isBuying) "BUY " else "SELL ")[1] val bazaarName = BazaarApi.getCleanBazaarName(rawName) - val data = BazaarApi.getBazaarDataForName(bazaarName) ?: return + val data = BazaarApi.getBazaarDataForName(bazaarName) + if (data == null) { + println("Bazaar data is null for '$rawName'/'$bazaarName'") + continue + } val itemLore = stack.getLore() for (line in itemLore) { if (line.startsWith("§7Filled:")) { if (line.endsWith(" §a§l100%!")) { slot highlight LorenzColor.GREEN - continue@out + break } } if (line.startsWith("§7Price per unit:")) { @@ -61,7 +65,7 @@ class BazaarOrderHelper { val price = text.toDouble() if (isSelling && price > data.buyPrice || isBuying && price < data.sellPrice) { slot highlight LorenzColor.GOLD - continue@out + break } } } |