diff options
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt | 10 |
1 files changed, 5 insertions, 5 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 da72f3e78..17d531dd6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt @@ -48,9 +48,7 @@ class MinionCraftHelper { if (tick % 10 == 0) { val mainInventory = Minecraft.getMinecraft()?.thePlayer?.inventory?.mainInventory ?: return - hasMinionInInventory = mainInventory - .mapNotNull { it?.name?.removeColor() } - .any { it.contains(" Minion ") && !it.contains(" Minion Skin") } + hasMinionInInventory = mainInventory.mapNotNull { it?.name }.any { isMinionName(it) } } if (tick % (60 * 2) == 0) { @@ -94,7 +92,7 @@ class MinionCraftHelper { for (item in mainInventory) { val name = item?.name?.removeColor() ?: continue val rawId = item.getInternalName() - if (name.contains(" Minion ")) { + if (isMinionName(name)) { minions[name] = rawId } } @@ -105,7 +103,7 @@ class MinionCraftHelper { for (item in mainInventory) { val name = item?.name?.removeColor() ?: continue val rawId = item.getInternalName() - if (!name.contains(" Minion ")) { + if (!isMinionName(name)) { if (!allIngredients.contains(rawId)) continue if (!isAllowed(allMinions, rawId)) continue @@ -255,4 +253,6 @@ class MinionCraftHelper { val next = lastText.toInt() + 1 return replace(lastText, "" + next) } + + private fun isMinionName(itemName: String) = itemName.contains(" Minion ") && !itemName.contains(" Minion Skin") } |