From e1d153de7fc5ad8511fa3d40b14d5815c9920096 Mon Sep 17 00:00:00 2001 From: alexia Date: Sun, 28 Jan 2024 18:44:59 +0100 Subject: 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 --- .../features/inventory/HideNotClickableItems.kt | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'src/main/java') 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("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 -- cgit