Skip to content

Commit

Permalink
migrate GardenCropMilestones
Browse files Browse the repository at this point in the history
  • Loading branch information
CalMWolfs committed Jan 1, 2024
1 parent 730835e commit 1b2fcdd
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package at.hannibal2.skyhanni.data

import at.hannibal2.skyhanni.data.jsonobjects.repo.GardenJson
import at.hannibal2.skyhanni.events.CropMilestoneUpdateEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.events.RepositoryReloadEvent
Expand All @@ -8,14 +9,19 @@ import at.hannibal2.skyhanni.features.garden.GardenAPI
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.data.jsonobjects.repo.GardenJson
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
import net.minecraft.item.ItemStack
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent

object GardenCropMilestones {
// TODO USE SH-REPO
private val cropPattern = "§7Harvest §f(?<name>.*) §7on .*".toPattern()
val totalPattern = "§7Total: §a(?<name>.*)".toPattern()
private val cropPattern by RepoPattern.pattern(
"data.garden.crop",
"§7Harvest §f(?<name>.*) §7on .*"
)
private val totalPattern by RepoPattern.pattern(
"data.garden.total",
"§7Total: §a(?<name>.*)"
)

fun getCropTypeByLore(itemStack: ItemStack): CropType? {
for (line in itemStack.getLore()) {
Expand Down

0 comments on commit 1b2fcdd

Please sign in to comment.