aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorfabi <85846799+fahr-plan@users.noreply.github.com>2024-06-01 09:23:41 +0200
committerGitHub <noreply@github.com>2024-06-01 09:23:41 +0200
commit1e9d11e39c7d7e68985d78e5b1f6f063fd8b4b52 (patch)
tree013783f92c3cb178b1acc90dbf6e0055e2f7f958 /src/main/java/at/hannibal2/skyhanni
parent2a12411a2bac767e800303f07704174ed4e17494 (diff)
downloadskyhanni-1e9d11e39c7d7e68985d78e5b1f6f063fd8b4b52.tar.gz
skyhanni-1e9d11e39c7d7e68985d78e5b1f6f063fd8b4b52.tar.bz2
skyhanni-1e9d11e39c7d7e68985d78e5b1f6f063fd8b4b52.zip
Change: getByNameOrNull using simpleName of Crop (#1970)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt
index dc15f136a..b7480f259 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt
@@ -69,7 +69,7 @@ enum class CropType(
fun getByNameOrNull(itemName: String): CropType? {
if (itemName == "Red Mushroom" || itemName == "Brown Mushroom") return MUSHROOM
if (itemName == "Seeds") return WHEAT
- return entries.firstOrNull { it.cropName.equals(itemName, ignoreCase = true) }
+ return entries.firstOrNull { it.cropName.equals(itemName, ignoreCase = true) || it.simpleName.equals(itemName, ignoreCase = true) }
}
fun getByName(name: String) = getByNameOrNull(name) ?: error("No valid crop type '$name'")