diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-09-28 15:28:34 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-09-28 15:28:34 +0200 |
commit | a967d76590f7970bc5d67914c55b98b34307f9d8 (patch) | |
tree | ff63d179bd94303e06a87d1ea840889a65203c46 /src/main/java/at/hannibal2/skyhanni/features | |
parent | 586947cbea3603fa1c89d4298a18c7a145f92704 (diff) | |
download | skyhanni-a967d76590f7970bc5d67914c55b98b34307f9d8.tar.gz skyhanni-a967d76590f7970bc5d67914c55b98b34307f9d8.tar.bz2 skyhanni-a967d76590f7970bc5d67914c55b98b34307f9d8.zip |
fixed lava fishing sack name
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt index 6ff33fd86..bc1d310cc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -78,10 +78,7 @@ class ItemDisplayOverlayFeatures { if (SkyHanniMod.feature.inventory.displaySackName) { if (ItemUtils.isSack(name)) { - //TODO fix this and replace other -// val sackName = grabSackName(name) - val split = name.split(" ") - val sackName = split[split.size - 2] + val sackName = grabSackName(name) return (if (name.contains("Enchanted")) "ยง5" else "") + sackName.substring(0, 2) } } @@ -89,12 +86,12 @@ class ItemDisplayOverlayFeatures { return "" } -// private fun grabSackName(name: String): String { -// val split = name.split(" ") -// val text = split[0] -// for (line in arrayOf("Large", "Medium", "Small", "Enchanted")) { -// if (text == line) return grabSackName(name.substring(text.length + 1)) -// } -// return text -// } + private fun grabSackName(name: String): String { + val split = name.split(" ") + val text = split[0] + for (line in arrayOf("Large", "Medium", "Small", "Enchanted")) { + if (text == line) return grabSackName(name.substring(text.length + 1)) + } + return text + } }
\ No newline at end of file |