diff options
author | Phoebe <77941535+catgirlseraid@users.noreply.github.com> | 2024-05-16 20:36:30 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-16 10:36:30 +0200 |
commit | df8d1f01dbe2511a766e288e8d110eb6856f0456 (patch) | |
tree | 63e8ca24154965acce6e011655989ceb6fc43fb0 /src/main/java/at/hannibal2/skyhanni/utils | |
parent | 388a656c95c745c8cced86931e9ab30e10e3bb9e (diff) | |
download | skyhanni-df8d1f01dbe2511a766e288e8d110eb6856f0456.tar.gz skyhanni-df8d1f01dbe2511a766e288e8d110eb6856f0456.tar.bz2 skyhanni-df8d1f01dbe2511a766e288e8d110eb6856f0456.zip |
Fixed choc shop profit calculations (#1805)
Co-authored-by: SeRaid <77941535+SeRaid743@users.noreply.github.com>
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt index c7c70d949..3026b0c56 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -386,4 +386,23 @@ object ItemUtils { } return name } + + fun ItemStack.loreCosts(): MutableList<NEUInternalName> { + var found = false + val list = mutableListOf<NEUInternalName>() + for (lines in getLore()) { + if (lines == "ยง7Cost") { + found = true + continue + } + + if (!found) continue + if (lines.isEmpty()) return list + + NEUInternalName.fromItemNameOrNull(lines)?.let { + list.add(it) + } + } + return list + } } |