From 57101a22643c81471f5773f64205bce5270c55eb Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 18 Apr 2023 17:11:27 +0200 Subject: Biofuel price in composter is manually maxed at 20k coins --- .../features/garden/composter/ComposterOverlay.kt | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/main') 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 fbca4aad9..67fd5c778 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 @@ -291,7 +291,7 @@ class ComposterOverlay { newList.addAsSingletonList(" §7$compostPerTitle: §e${multiplier.round(2)}$compostPerTitlePreview") - val organicMatterPrice = NEUItems.getPrice(organicMatterItem) + val organicMatterPrice = getPrice(organicMatterItem) val organicMatterFactor = organicMatterFactors[organicMatterItem]!! val organicMatterRequired = ComposterAPI.organicMatterRequiredPer(null) @@ -300,7 +300,7 @@ class ComposterOverlay { val organicMatterPricePer = organicMatterPrice * (organicMatterRequired / organicMatterFactor) val organicMatterPricePerPreview = organicMatterPrice * (organicMatterRequiredPreview / organicMatterFactor) - val fuelPrice = NEUItems.getPrice(fuelItem) + val fuelPrice = getPrice(fuelItem) val fuelFactor = fuelFactors[fuelItem]!! val fuelRequired = ComposterAPI.fuelRequiredPer(null) @@ -319,7 +319,7 @@ class ComposterOverlay { newList.addAsSingletonList(materialCostFormat) - val priceCompost = NEUItems.getPrice("COMPOST") + val priceCompost = getPrice("COMPOST") val profit = (priceCompost - (fuelPricePer + organicMatterPricePer)) * multiplier val profitPreview = (priceCompost - (fuelPricePerPreview + organicMatterPricePerPreview)) * multiplierPreview @@ -338,7 +338,7 @@ class ComposterOverlay { ): String { val map = mutableMapOf() for ((internalName, factor) in factors) { - map[internalName] = factor / NEUItems.getPrice(internalName) + map[internalName] = factor / getPrice(internalName) } var i = 0 @@ -349,7 +349,7 @@ class ComposterOverlay { val item = NEUItems.getItemStack(internalName) val itemName = item.name!! - val price = NEUItems.getPrice(internalName) + val price = getPrice(internalName) val itemsNeeded = ceil(missing / factor) val totalPrice = itemsNeeded * price @@ -372,6 +372,13 @@ class ComposterOverlay { return first!! } + private fun getPrice(internalName: String): Double { + val price = NEUItems.getPrice(internalName) + if (internalName == "BIOFUEL" && price > 20_000) return 20_000.0 + + return price + } + @SubscribeEvent fun onRepoReload(event: RepositoryReloadEvent) { try { -- cgit