diff options
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/Hidden.java | 3 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt | 14 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Hidden.java b/src/main/java/at/hannibal2/skyhanni/config/features/Hidden.java index f1b161474..209ac61f3 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Hidden.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Hidden.java @@ -68,4 +68,7 @@ public class Hidden { @Expose public Map<ComposterUpgrade, Integer> gardenComposterUpgrades = new HashMap<>(); + + @Expose + public Map<CropType, Boolean> gardenToolHasBountiful = new HashMap<>(); } 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 5757a5c61..d9e9dd7c8 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 @@ -17,9 +17,11 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.sortedDesc import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getReforgeName import at.hannibal2.skyhanni.utils.StringUtils.removeColor import io.github.moulberry.notenoughupdates.NotEnoughUpdates import kotlinx.coroutines.launch +import net.minecraft.client.Minecraft import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import net.minecraftforge.fml.common.gameevent.TickEvent @@ -32,6 +34,7 @@ class CropMoneyDisplay { private var multipliers = mapOf<String, Int>() private val cropNames = mutableMapOf<String, CropType>() // internalName -> cropName private var hasCropInHand = false + private val toolHasBountiful: MutableMap<CropType, Boolean> get() = SkyHanniMod.feature.hidden.gardenToolHasBountiful @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { @@ -85,6 +88,13 @@ class CropMoneyDisplay { return newDisplay } + GardenAPI.cropInHand?.let { + val heldItem = Minecraft.getMinecraft().thePlayer.heldItem + val reforgeName = heldItem.getReforgeName() + val bountiful = reforgeName == "bountiful" + toolHasBountiful[it] = bountiful + } + val moneyPerHourData = calculateMoneyPerHour() if (moneyPerHourData.isEmpty()) { if (!GardenAPI.isSpeedDataEmpty()) { @@ -237,7 +247,9 @@ class CropMoneyDisplay { } } - moneyPerHours[internalName] = formatNumbers(sellOffer, instantSell, npcPrice) + val bountifulMoney = if (toolHasBountiful[crop] == true) speedPerHour * 0.2 else 0.0 + moneyPerHours[internalName] = + formatNumbers(sellOffer + bountifulMoney, instantSell + bountifulMoney, npcPrice + bountifulMoney) } return moneyPerHours } |