summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorErymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>2023-09-28 03:07:33 -0400
committerGitHub <noreply@github.com>2023-09-28 09:07:33 +0200
commit6a187104e5f88f61069c2c034fa8a1d2375e336e (patch)
treec6973e7d8134006f63908c968be8eb5003a3336d /src/main/java/at/hannibal2/skyhanni/utils
parent993fe26c68aeaf39e4a7187df44231ebe48214da (diff)
downloadskyhanni-6a187104e5f88f61069c2c034fa8a1d2375e336e.tar.gz
skyhanni-6a187104e5f88f61069c2c034fa8a1d2375e336e.tar.bz2
skyhanni-6a187104e5f88f61069c2c034fa8a1d2375e336e.zip
Bugfix: Revise isSack() to rely on internal name instead (#510)
Fixed Bazaar Item category "Ink Sack" gets wrongly detected as an item sack. #510
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
index 4fd35a330..ee753e17d 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
@@ -21,8 +21,8 @@ object ItemUtils {
fun ItemStack.cleanName() = this.displayName.removeColor()
- fun isSack(name: String): Boolean =
- name.endsWith(" Sack")//TODO use item id or api or something? or dont, its working fine now
+ fun isSack(stack: ItemStack): Boolean =
+ stack?.getInternalName()?.endsWith("_SACK") ?: false
fun ItemStack.getLore(): List<String> {
val tagCompound = this.tagCompound ?: return emptyList()