From a967d76590f7970bc5d67914c55b98b34307f9d8 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 28 Sep 2022 15:28:34 +0200 Subject: fixed lava fishing sack name --- .../inventory/ItemDisplayOverlayFeatures.kt | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') 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 -- cgit