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 | 4fb75f583cddf2d8c8a40f870148d6ad37c27412 (patch) | |
| tree | 505253fb8e5e28637f9e7c0e93c5888b1428921f | |
| parent | 785659c87d5a20c96224d94f93f48727a19949f2 (diff) | |
| download | SkyHanni-4fb75f583cddf2d8c8a40f870148d6ad37c27412.tar.gz SkyHanni-4fb75f583cddf2d8c8a40f870148d6ad37c27412.tar.bz2 SkyHanni-4fb75f583cddf2d8c8a40f870148d6ad37c27412.zip | |
Fixed bazaar helper display.
| -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 } } } |
