diff options
author | Lorenz <ESs95s3P5z8Pheb> | 2022-07-15 22:57:48 +0200 |
---|---|---|
committer | Lorenz <ESs95s3P5z8Pheb> | 2022-07-15 22:57:48 +0200 |
commit | e540598b94ae1e495e4bc4ef958799063225831d (patch) | |
tree | 2c2adfb94aa33534da42c2c118f88961b39a4bc6 /src/main/java/at/hannibal2 | |
parent | 5cdd4e0b75b97598b46a548422b083573833956c (diff) | |
download | skyhanni-e540598b94ae1e495e4bc4ef958799063225831d.tar.gz skyhanni-e540598b94ae1e495e4bc4ef958799063225831d.tar.bz2 skyhanni-e540598b94ae1e495e4bc4ef958799063225831d.zip |
fixed coop soulbound item check
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt | 10 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt | 5 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt index 8e2b0ceb1..4bcb827ac 100644 --- a/src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt @@ -40,12 +40,8 @@ class HideNotClickableItems { val hideNotClickableItems = event.getConstant("HideNotClickableItems")!! hideNpcSellFilter.load(hideNotClickableItems["hide_npc_sell"].asJsonObject) hideInStorageFilter.load(hideNotClickableItems["hide_in_storage"].asJsonObject) - - val tradeNpcs = event.getConstant("TradeNpcs")!! - tradeNpcFilter.load(tradeNpcs) - + tradeNpcFilter.load(event.getConstant("TradeNpcs")!!) updateSalvageList(hideNotClickableItems) - hidePlayerTradeFilter.load(hideNotClickableItems["hide_player_trade"].asJsonObject) notAuctionableFilter.load(hideNotClickableItems["not_auctionable"].asJsonObject) @@ -242,7 +238,7 @@ class HideNotClickableItems { private fun hidePlayerTrade(chestName: String, stack: ItemStack): Boolean { if (!chestName.startsWith("You ")) return false - if (ItemUtils.isSoulBound(stack)) { + if (ItemUtils.isCoopSoulBound(stack)) { hideReason = "Soulbound items cannot be traded!" return true } @@ -368,7 +364,7 @@ class HideNotClickableItems { } private fun isNotAuctionable(stack: ItemStack): Boolean { - if (ItemUtils.isSoulBound(stack)) { + if (ItemUtils.isCoopSoulBound(stack)) { 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 243cbc1dd..60858bc27 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -31,7 +31,10 @@ object ItemUtils { fun ItemStack.getLore() = ItemUtil.getItemLore(this) - fun isSoulBound(stack: ItemStack): Boolean = stack.getLore().any { it.contains(" Soulbound ") } + fun isCoopSoulBound(stack: ItemStack): Boolean = + stack.getLore().any { + it == "§8§l* §8Co-op Soulbound §8§l*" || it == "§8§l* §8Soulbound §8§l*" + } fun isRecombobulated(stack: ItemStack): Boolean = stack.getLore().any { it.contains("§k") } |