aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-03 23:24:32 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-03 23:24:32 +0100
commit914f78e3cb19c73b357f58cf54c9534094cbef1a (patch)
treec142827a6f8b0896ae7691dc9270be1e8f3dfd14 /src/main
parent09c79e6e9c38c651f297c2aff9907d425c5179f2 (diff)
downloadskyhanni-914f78e3cb19c73b357f58cf54c9534094cbef1a.tar.gz
skyhanni-914f78e3cb19c73b357f58cf54c9534094cbef1a.tar.bz2
skyhanni-914f78e3cb19c73b357f58cf54c9534094cbef1a.zip
Fixed bingo crash with minion skins (this time for real)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt10
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")
}