From e7b2ef2728d2fc04eef1e5872a7723d63a7c85bd Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 2 Dec 2023 18:53:51 +0100 Subject: Hide enchanted tools in Minion Craft Helper. --- .../java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt | 2 ++ src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt | 5 +++++ 2 files changed, 7 insertions(+) (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt index 8c027fcf3..62106622f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.ProfileJoinEvent import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old +import at.hannibal2.skyhanni.utils.ItemUtils.hasEnchantments import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUItems @@ -107,6 +108,7 @@ class MinionCraftHelper { for (item in mainInventory) { val name = item?.name?.removeColor() ?: continue + if (item.hasEnchantments()) continue val rawId = item.getInternalName_old() if (!isMinionName(name)) { if (!allIngredients.contains(rawId)) continue diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt index a1b7ed09f..1265dcc3c 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.utils.NEUItems.getItemStack import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber import at.hannibal2.skyhanni.utils.SimpleTimeMark.Companion.asTimeMark import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.cachedData +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEnchantments import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.isRecombobulated import at.hannibal2.skyhanni.utils.StringUtils.matchRegex import at.hannibal2.skyhanni.utils.StringUtils.removeColor @@ -133,8 +134,12 @@ object ItemUtils { fun ItemStack.isVanilla() = NEUItems.isVanillaItem(this) + // Checks for the enchantment glint as part of the minecraft enchantments fun ItemStack.isEnchanted() = isItemEnchanted + // Checks for hypixel enchantments in the attributes + fun ItemStack.hasEnchantments() = getEnchantments()?.isNotEmpty() ?: false + fun ItemStack.getSkullTexture(): String? { if (item != Items.skull) return null if (tagCompound == null) return null -- cgit