From 7917a6b60102edec628ec19d70c31b92c689e8f8 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 25 Apr 2023 22:50:26 +0200 Subject: Added the command '/shcroptime ' that displays the estimated time it will take to gather the requested quantity of a particular item based on the current crop speed. --- src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/java/at/hannibal2/skyhanni/data') 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) } -- cgit