aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt12
2 files changed, 9 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt
index 2f88c52de..aab3b082b 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt
@@ -16,6 +16,7 @@ import java.util.*
import kotlin.time.Duration
import kotlin.time.Duration.Companion.seconds
import kotlin.time.DurationUnit
+import kotlin.math.floor
class ComposterDisplay {
private val config get() = SkyHanniMod.feature.garden
@@ -69,8 +70,8 @@ class ComposterDisplay {
val organicMatterRequired = ComposterAPI.organicMatterRequiredPer(null)
val fuelRequired = ComposterAPI.fuelRequiredPer(null)
- val organicMatterRemaining = organicMatter / organicMatterRequired
- val fuelRemaining = fuel / fuelRequired
+ val organicMatterRemaining = floor(organicMatter / organicMatterRequired)
+ val fuelRemaining = floor(fuel / fuelRequired)
val endOfOrganicMatter = timePerCompost * organicMatterRemaining
val endOfFuel = timePerCompost * fuelRemaining
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
index 66c7b2c41..67a288e66 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
@@ -201,9 +201,9 @@ class ComposterOverlay {
val matterPer = ComposterAPI.organicMatterRequiredPer(null)
val matterPerPreview = ComposterAPI.organicMatterRequiredPer(upgrade)
- val matterMaxDuration = ComposterAPI.timePerCompost(null) * (maxOrganicMatter / matterPer)
+ val matterMaxDuration = ComposterAPI.timePerCompost(null) * floor(maxOrganicMatter / matterPer)
val matterMaxDurationPreview =
- ComposterAPI.timePerCompost(upgrade) * (maxOrganicMatterPreview / matterPerPreview)
+ ComposterAPI.timePerCompost(upgrade) * floor(maxOrganicMatterPreview / matterPerPreview)
var format = formatTime(matterMaxDuration)
var formatPreview =
@@ -217,9 +217,9 @@ class ComposterOverlay {
val fuelRequiredPer = ComposterAPI.fuelRequiredPer(null)
val fuelRequiredPerPreview = ComposterAPI.fuelRequiredPer(upgrade)
- val fuelMaxDuration = ComposterAPI.timePerCompost(null) * (maxFuel / fuelRequiredPer)
+ val fuelMaxDuration = ComposterAPI.timePerCompost(null) * floor(maxFuel / fuelRequiredPer)
val fuelMaxDurationPreview =
- ComposterAPI.timePerCompost(upgrade) * (maxFuelPreview / fuelRequiredPerPreview)
+ ComposterAPI.timePerCompost(upgrade) * floor(maxFuelPreview / fuelRequiredPerPreview)
format = formatTime(fuelMaxDuration)
formatPreview =
@@ -350,8 +350,8 @@ class ComposterOverlay {
val priceCompost = getPrice("COMPOST")
- val profit = (priceCompost - (fuelPricePer + organicMatterPricePer)) * multiplier
- val profitPreview = (priceCompost - (fuelPricePerPreview + organicMatterPricePerPreview)) * multiplierPreview
+ val profit = ((priceCompost * multiDropFactor) - (fuelPricePer + organicMatterPricePer))*timeMultiplier
+ val profitPreview = ((priceCompost * multiDropFactorPreview) - (fuelPricePerPreview + organicMatterPricePerPreview))*timeMultiplierPreview
val profitFormatPreview = if (profit != profitPreview) " §c➜ §6" + NumberUtil.format(profitPreview) else ""
val profitFormat = " §7Profit per $timeText: §6${NumberUtil.format(profit)}$profitFormatPreview"