aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-25 22:50:26 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-25 22:50:26 +0200
commit7917a6b60102edec628ec19d70c31b92c689e8f8 (patch)
treed1764e2e86b586c03733fe9e07a6171e86539ad6 /src/main/java/at/hannibal2/skyhanni/data
parentaf3567ad9f65f8495b889428c04da12f85d35aec (diff)
downloadskyhanni-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.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)
}