aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-16 01:44:38 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-04-16 01:44:38 +0200
commitfa7360b6923ca8e4edea5c788cb38a3b941a6e12 (patch)
tree09c36b8a049a0e375b90cfb7eb851c2b74b65882 /src/main
parent805f25fcdafc73c600e0aced777f6a55589233a4 (diff)
downloadskyhanni-fa7360b6923ca8e4edea5c788cb38a3b941a6e12.tar.gz
skyhanni-fa7360b6923ca8e4edea5c788cb38a3b941a6e12.tar.bz2
skyhanni-fa7360b6923ca8e4edea5c788cb38a3b941a6e12.zip
bountiful 0.2 coins bonus gets added to the money/hour (requires you to hold the hoe with bountiful in the hand to update)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Hidden.java3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt14
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
}