aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
authoralexia <me@alexia.lol>2024-01-28 18:44:59 +0100
committerGitHub <noreply@github.com>2024-01-28 18:44:59 +0100
commite1d153de7fc5ad8511fa3d40b14d5815c9920096 (patch)
tree2b1956d413011951eb47da2246e9598c69f5e100 /src/main/java/at/hannibal2
parent4487d168e4db417767dfae55860b1478e3ee2696 (diff)
downloadskyhanni-e1d153de7fc5ad8511fa3d40b14d5815c9920096.tar.gz
skyhanni-e1d153de7fc5ad8511fa3d40b14d5815c9920096.tar.bz2
skyhanni-e1d153de7fc5ad8511fa3d40b14d5815c9920096.zip
Hide non-clickable items in Basket of Seeds, Nether Wart Pouch & Trick or Treat Bag (#951)
Hide non-clickable items in Basket of Seeds, Nether Wart Pouch & Trick or Treat Bag #951
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt55
1 files changed, 55 insertions, 0 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 ac9c402e7..9b1cc5e26 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt
@@ -26,9 +26,12 @@ import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.equalsOneOf
import at.hannibal2.skyhanni.utils.MultiFilter
+import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.isRiftExportable
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.isRiftTransferable
+import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
+import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.inventory.GuiChest
import net.minecraft.inventory.ContainerChest
@@ -52,6 +55,11 @@ class HideNotClickableItems {
private val hidePlayerTradeFilter = MultiFilter()
private val notAuctionableFilter = MultiFilter()
+ private val seedsPattern by RepoPattern.pattern(
+ "inventory.hidenotclickable.seeds",
+ "SEEDS|CARROT_ITEM|POTATO_ITEM|PUMPKIN_SEEDS|SUGAR_CANE|MELON_SEEDS|CACTUS|INK_SACK-3"
+ )
+
@SubscribeEvent
fun onRepoReload(event: RepositoryReloadEvent) {
val hideNotClickable = event.getConstant<HideNotClickableItemsJson>("HideNotClickableItems")
@@ -176,6 +184,9 @@ class HideNotClickableItems {
hidePlayerTrade(chestName, stack) -> true
hideBazaarOrAH(chestName, stack) -> true
hideAccessoryBag(chestName, stack) -> true
+ hideBasketOfSeeds(chestName, stack) -> true
+ hideNetherWartPouch(chestName, stack) -> true
+ hideTrickOrTreatBag(chestName, stack) -> true
hideSackOfSacks(chestName, stack) -> true
hideFishingBag(chestName, stack) -> true
hidePotionBag(chestName, stack) -> true
@@ -347,6 +358,50 @@ class HideNotClickableItems {
return true
}
+ private fun hideBasketOfSeeds(chestName: String, stack: ItemStack): Boolean {
+ if (!chestName.startsWith("Basket of Seeds")) return false
+
+ if (ItemUtils.isSkyBlockMenuItem(stack)) {
+ hideReason = "The SkyBlock Menu cannot be put into the basket of seeds!"
+ return true
+ }
+
+ seedsPattern.matchMatcher(stack.getInternalName().asString()) {
+ return false
+ }
+
+ hideReason = "This item is not a seed!"
+ return true
+ }
+
+ private fun hideNetherWartPouch(chestName: String, stack: ItemStack): Boolean {
+ if (!chestName.startsWith("Nether Wart Pouch")) return false
+
+ if (ItemUtils.isSkyBlockMenuItem(stack)) {
+ hideReason = "The SkyBlock Menu cannot be put into the nether wart pouch!"
+ return true
+ }
+
+ if (stack.getInternalName() == "NETHER_STALK".asInternalName()) return false
+
+ hideReason = "This item is not a nether wart!"
+ return true
+ }
+
+ private fun hideTrickOrTreatBag(chestName: String, stack: ItemStack): Boolean {
+ if (!chestName.startsWith("Trick or Treat Bag")) return false
+
+ if (ItemUtils.isSkyBlockMenuItem(stack)) {
+ hideReason = "The SkyBlock Menu cannot be put into the trick or treat bag!"
+ return true
+ }
+
+ if (stack.cleanName() == "Green Candy" || stack.cleanName() == "Purple Candy") return false
+
+ hideReason = "This item is not a spooky candy!"
+ return true
+ }
+
private fun hidePlayerTrade(chestName: String, stack: ItemStack): Boolean {
if (!chestName.startsWith("You ")) return false