diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt b/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt index 04717a9a5..aa797add1 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GardenCropUpgrades.kt @@ -29,14 +29,9 @@ class GardenCropUpgrades { fun onInventoryOpen(event: InventoryOpenEvent) { if (event.inventoryName != "Crop Upgrades") return event.inventoryItems.forEach { (_, item) -> - val crop = item.name?.removeColor()?.let { - CropType.getByNameOrNull(it) - } ?: return@forEach - println("finding for '$crop'") - val level = item.getLore().firstNotNullOfOrNull { - tierPattern.matchEntire(it)?.groups?.get(1)?.value?.toIntOrNull() - } ?: 0 - println("found: $level") + val crop = item.name?.removeColor()?.let { CropType.getByNameOrNull(it) } ?: return@forEach + val level = item.getLore() + .firstNotNullOfOrNull { tierPattern.matchEntire(it)?.groups?.get(1)?.value?.toIntOrNull() } ?: 0 crop.setUpgradeLevel(level) } CropUpgradeUpdateEvent().postAndCatch() |