aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorLorenz <ESs95s3P5z8Pheb>2022-07-15 23:06:42 +0200
committerLorenz <ESs95s3P5z8Pheb>2022-07-15 23:06:42 +0200
commitfc7ea4ec94923498cbb1cba9186ae8c076476e97 (patch)
treef8488ee2de46507b3b2cc05ac6fc50659913a77a /src/main
parente540598b94ae1e495e4bc4ef958799063225831d (diff)
downloadskyhanni-fc7ea4ec94923498cbb1cba9186ae8c076476e97.tar.gz
skyhanni-fc7ea4ec94923498cbb1cba9186ae8c076476e97.tar.bz2
skyhanni-fc7ea4ec94923498cbb1cba9186ae8c076476e97.zip
add private island chest to hide not clickable items
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt11
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt3
2 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt
index 4bcb827ac..e7bdbd300 100644
--- a/src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt
@@ -178,11 +178,22 @@ class HideNotClickableItems {
hideSackOfSacks(chestName, stack) -> true
hideFishingBag(chestName, stack) -> true
hidePotionBag(chestName, stack) -> true
+ hidePrivateIslandChest(chestName, stack) -> true
else -> false
}
}
+ private fun hidePrivateIslandChest(chestName: String, stack: ItemStack): Boolean {
+ if (chestName != "Chest" && chestName != "Large Chest") return false
+ //TODO make check if player is on private island
+
+ if (!ItemUtils.isSoulBound(stack)) return false
+
+ hideReason = "This item cannot be stored into a chest!"
+ return true
+ }
+
private fun hidePotionBag(chestName: String, stack: ItemStack): Boolean {
if (!chestName.startsWith("Potion Bag")) return false
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
index 60858bc27..83b4ae3da 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
@@ -36,6 +36,9 @@ object ItemUtils {
it == "§8§l* §8Co-op Soulbound §8§l*" || it == "§8§l* §8Soulbound §8§l*"
}
+ fun isSoulBound(stack: ItemStack): Boolean =
+ stack.getLore().any { it == "§8§l* §8Soulbound §8§l*" }
+
fun isRecombobulated(stack: ItemStack): Boolean = stack.getLore().any { it.contains("§k") }
fun isPet(name: String): Boolean = name.matchRegex("\\[Lvl (.*)] (.*)") && !listOf(