diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/Garden.java | 8 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt | 11 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java index 75f934584..bfa578547 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java @@ -97,12 +97,18 @@ public class Garden { public boolean visitorExactAmountAndTime = true; @Expose - @ConfigOption(name = "Copper Price", desc = "Show the price for copper inside the visitor gui.") + @ConfigOption(name = "Copper Price", desc = "Show the price per copper inside the visitor gui.") @ConfigEditorBoolean @ConfigAccordionId(id = 4) public boolean visitorCopperPrice = false; @Expose + @ConfigOption(name = "Experience Price", desc = "Show the price per garden experience inside the visitor gui.") + @ConfigEditorBoolean + @ConfigAccordionId(id = 4) + public boolean visitorExperiencePrice = false; + + @Expose @ConfigOption(name = "Notification Chat", desc = "Show in chat when a new visitor is visiting your island.") @ConfigEditorBoolean @ConfigAccordionId(id = 1) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt index fb08d212c..85b311c10 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt @@ -34,6 +34,7 @@ class GardenVisitorFeatures { private var onBarnPlot = false private var tick = 0 private val copperPattern = Pattern.compile(" §8\\+§c(.*) Copper") + private val gardenExperiencePattern = Pattern.compile(" §8\\+§2(.*) §7Garden Experience") private val offerAcceptedPattern = Pattern.compile("§6§lOFFER ACCEPTED §r§8with §r(.*) §r.*") private val config get() = SkyHanniMod.feature.garden @@ -256,7 +257,15 @@ class GardenVisitorFeatures { if (matcher.matches()) { val coppers = matcher.group(1).replace(",", "").toInt() val pricePerCopper = NumberUtil.format((totalPrice / coppers).toInt()) - list[i + itemsWithSpeedCounter] = "$line §7(Copper price §6$pricePerCopper§7)" + list[i + itemsWithSpeedCounter] = "$line §7(price per §6$pricePerCopper§7)" + } + } + if (config.visitorExperiencePrice) { + val matcher = gardenExperiencePattern.matcher(line) + if (matcher.matches()) { + val gardenExp = matcher.group(1).replace(",", "").toInt() + val pricePerCopper = NumberUtil.format((totalPrice / gardenExp).toInt()) + list[i + itemsWithSpeedCounter] = "$line §7(price per §6$pricePerCopper§7)" } } } |