From cb0fc44d95a22523cc4423b64a88046899ec9350 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 16 Apr 2023 02:18:43 +0200 Subject: Mushroom Cow Perk 'Mushroom Eater' counts the extra mushrooms as money to your money/hour display --- .../skyhanni/features/garden/farming/CropMoneyDisplay.kt | 13 ++++++++++++- .../features/garden/farming/GardenCropMilestoneDisplay.kt | 4 +++- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt index d9e9dd7c8..1c0ab2b47 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt @@ -88,11 +88,22 @@ class CropMoneyDisplay { return newDisplay } + var extraNetherWartPrices = 0.0 GardenAPI.cropInHand?.let { val heldItem = Minecraft.getMinecraft().thePlayer.heldItem val reforgeName = heldItem.getReforgeName() val bountiful = reforgeName == "bountiful" toolHasBountiful[it] = bountiful + + if (GardenAPI.mushroomCowPet && it != CropType.MUSHROOM) { + if (!GardenCropMilestoneDisplay.mushroom_cow_nether_warts || it != CropType.NETHER_WART) { + val redPrice = NEUItems.getPrice("ENCHANTED_RED_MUSHROOM") / 160 + val brownPrice = NEUItems.getPrice("ENCHANTED_BROWN_MUSHROOM") / 160 + val mushroomPrice = (redPrice + brownPrice) / 2 + val perSecond = 20.0 * it.multiplier * mushroomPrice + extraNetherWartPrices = perSecond * 60 * 60 + } + } } val moneyPerHourData = calculateMoneyPerHour() @@ -148,7 +159,7 @@ class CropMoneyDisplay { val moneyArray = moneyPerHourData[internalName]!! for (price in moneyArray) { - val format = format(price) + val format = format(price + extraNetherWartPrices) list.add("$coinsColor$format") list.add("ยง7/") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt index 92b27e094..d40c7e21c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt @@ -38,7 +38,9 @@ class GardenCropMilestoneDisplay { private var needsInventory = false - private var mushroom_cow_nether_warts = true + companion object { + var mushroom_cow_nether_warts = true + } @SubscribeEvent fun onRepoReload(event: RepositoryReloadEvent) { -- cgit