aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-02 18:53:51 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-02 18:53:51 +0100
commite7b2ef2728d2fc04eef1e5872a7723d63a7c85bd (patch)
tree1ba5632b6b6b2c53332b855481e9cc5e6d92327f /src/main/java/at
parentba52a1ef37d734419191789b1953deae7dfff247 (diff)
downloadskyhanni-e7b2ef2728d2fc04eef1e5872a7723d63a7c85bd.tar.gz
skyhanni-e7b2ef2728d2fc04eef1e5872a7723d63a7c85bd.tar.bz2
skyhanni-e7b2ef2728d2fc04eef1e5872a7723d63a7c85bd.zip
Hide enchanted tools in Minion Craft Helper.
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt5
2 files changed, 7 insertions, 0 deletions
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