aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt4
2 files changed, 7 insertions, 6 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 3fad28589..c2e8801ba 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt
@@ -26,6 +26,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull
import at.hannibal2.skyhanni.utils.ItemUtils.getItemCategoryOrNull
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
+import at.hannibal2.skyhanni.utils.ItemUtils.isCoopSoulBound
import at.hannibal2.skyhanni.utils.ItemUtils.isEnchanted
import at.hannibal2.skyhanni.utils.ItemUtils.isVanilla
import at.hannibal2.skyhanni.utils.KeyboardManager
@@ -68,7 +69,7 @@ object HideNotClickableItems {
private val seedsPattern by RepoPattern.pattern(
"inventory.hidenotclickable.seeds",
- "SEEDS|CARROT_ITEM|POTATO_ITEM|PUMPKIN_SEEDS|SUGAR_CANE|MELON_SEEDS|CACTUS|INK_SACK-3"
+ "SEEDS|CARROT_ITEM|POTATO_ITEM|PUMPKIN_SEEDS|SUGAR_CANE|MELON_SEEDS|CACTUS|INK_SACK-3",
)
private val netherWart by lazy { "NETHER_STALK".asInternalName() }
@@ -304,7 +305,7 @@ object HideNotClickableItems {
"CLOAK",
"BELT",
"GLOVES",
- "BRACELET"
+ "BRACELET",
)
for (type in list) {
if (stack.getLore().any { it.contains("§l") && it.contains(type) }) {// todo use item api
@@ -445,7 +446,7 @@ object HideNotClickableItems {
private fun hidePlayerTrade(chestName: String, stack: ItemStack): Boolean {
if (!chestName.startsWith("You ")) return false
- if (ItemUtils.isCoopSoulBound(stack)) {
+ if (stack.isCoopSoulBound()) {
hideReason = "Soulbound items cannot be traded!"
return true
}
@@ -582,7 +583,7 @@ object HideNotClickableItems {
}
private fun isNotAuctionable(stack: ItemStack): Boolean {
- if (ItemUtils.isCoopSoulBound(stack)) {
+ if (stack.isCoopSoulBound()) {
hideReason = "Soulbound items cannot be auctioned!"
return true
}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
index 54cdfa91e..1fb4c4554 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
@@ -44,8 +44,8 @@ object ItemUtils {
}
// TODO change else janni is sad
- fun isCoopSoulBound(stack: ItemStack): Boolean =
- stack.getLore().any {
+ fun ItemStack.isCoopSoulBound(): Boolean =
+ getLore().any {
it == "§8§l* §8Co-op Soulbound §8§l*" || it == "§8§l* §8Soulbound §8§l*"
}