diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-25 22:50:26 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-25 22:50:26 +0200 |
commit | 7917a6b60102edec628ec19d70c31b92c689e8f8 (patch) | |
tree | d1764e2e86b586c03733fe9e07a6171e86539ad6 /src/main/java/at/hannibal2/skyhanni/data | |
parent | af3567ad9f65f8495b889428c04da12f85d35aec (diff) | |
download | skyhanni-7917a6b60102edec628ec19d70c31b92c689e8f8.tar.gz skyhanni-7917a6b60102edec628ec19d70c31b92c689e8f8.tar.bz2 skyhanni-7917a6b60102edec628ec19d70c31b92c689e8f8.zip |
Added the command '/shcroptime <amount> <item>' that displays the estimated time it will take to gather the requested quantity of a particular item based on the current crop speed.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt | 3 |
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) } |