aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt b/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt
index 07b796b33..e5ece4acc 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt
@@ -5,6 +5,7 @@ import at.hannibal2.skyhanni.events.CropUpgradeUpdateEvent
import at.hannibal2.skyhanni.events.InventoryOpenEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.features.garden.CropType
+import at.hannibal2.skyhanni.features.garden.CropType.Companion.getByNameOrNull
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.ItemUtils.name
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
@@ -17,7 +18,7 @@ class GardenCropUpgrades {
@SubscribeEvent
fun onChat(event: LorenzChatEvent) {
chatUpgradePattern.matchEntire(event.message)?.groups?.let { matches ->
- val crop = CropType.getByItemName(matches[1]!!.value) ?: return
+ val crop = getByNameOrNull(matches[1]!!.value) ?: return
val level = matches[2]!!.value.toInt()
crop.setUpgradeLevel(level)
}