diff options
Diffstat (limited to 'src')
4 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt index 203bfe9c9..49f1d4bfa 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt @@ -337,7 +337,7 @@ class HideNotClickableItems { val name = stack.cleanName() reverseColor = true - if (ItemUtils.isSack(name)) return false + if (ItemUtils.isSack(stack)) return false hideReason = "This item is not a sack!" @@ -370,7 +370,7 @@ class HideNotClickableItems { val name = stack.cleanName() - if (ItemUtils.isSack(name)) { + if (ItemUtils.isSack(stack)) { hideReason = "Sacks cannot be traded!" return true } @@ -497,7 +497,7 @@ class HideNotClickableItems { val name = stack.cleanName() - if (ItemUtils.isSack(name)) { + if (ItemUtils.isSack(stack)) { hideReason = "Sacks cannot be auctioned!" return true } 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 37a44f6ed..44e5cf46f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -90,7 +90,7 @@ class ItemDisplayOverlayFeatures { } if (SkyHanniMod.feature.inventory.displaySackName) { - if (ItemUtils.isSack(itemName)) { + if (ItemUtils.isSack(item)) { val sackName = grabSackName(itemName) return (if (itemName.contains("Enchanted")) "ยง5" else "") + sackName.substring(0, 2) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt index 58b7924b1..7e34aa009 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt @@ -35,7 +35,7 @@ class PocketSackInASackDisplay { val itemStack = event.itemStack val applied = itemStack.getAppliedPocketSackInASack() ?: return - if (!ItemUtils.isSack(itemStack.displayName)) return + if (!ItemUtils.isSack(itemStack)) return val iterator = event.toolTip.listIterator() var next = false for (line in iterator) { 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() |