aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
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(